Neopyros Posted August 21, 2007 Share Posted August 21, 2007 I have to compare a word, with the value of a position in my array, so far so good but here's my problem: if($file[$i][6] == 'Job="$_POST[slg]"') echo 'found'; I can't compare with the value submitted in the previous page plus a content in the document, how should i do it? The person will submit the word for example Test, and i need to compare the position with the value Job="Test" Quote Link to comment https://forums.phpfreaks.com/topic/65970-solved-easy-one-i-guess/ Share on other sites More sharing options...
ToonMariner Posted August 21, 2007 Share Posted August 21, 2007 errrr.... sorry lost me.... BUT if you have an array of strings that you want to search for a term then use array_keys($arr,$lookfor); - this will return all teh kesy of the array that match. if $arr us multi dimensional - then put the correct index in ie. $arr['jobtitles']. I didn't really understand your post so if I am way off I apologize but your explanation was IMO bloody awful!!!! Quote Link to comment https://forums.phpfreaks.com/topic/65970-solved-easy-one-i-guess/#findComment-329861 Share on other sites More sharing options...
Neopyros Posted August 21, 2007 Author Share Posted August 21, 2007 Ok, let me try again, sorry... I have a multi dimensional array, but i know the position to look for, so i don't want to search the entire array. BUT, the content is Job="Test". The user will submit only the word Test for the search, i need to compare the position in my array, with Job="$_POST[slg]" but this won't work in php. I guess now it's clear. Quote Link to comment https://forums.phpfreaks.com/topic/65970-solved-easy-one-i-guess/#findComment-329873 Share on other sites More sharing options...
MadTechie Posted August 21, 2007 Share Posted August 21, 2007 not to me! if you have an array in an array you can search part of it like this in_array("blar", myarray['demo']); will search in the array inside myarray['demo'] Quote Link to comment https://forums.phpfreaks.com/topic/65970-solved-easy-one-i-guess/#findComment-329876 Share on other sites More sharing options...
ToonMariner Posted August 21, 2007 Share Posted August 21, 2007 if you know teh position of the text in the array then I don't see what you need to do but if 9strcasecomp($arr['x']['y'], "Job=" . $_POST['slg']) == 0) { echo 'found';} honestly though mate your explanations are god awful.... truely awful. Quote Link to comment https://forums.phpfreaks.com/topic/65970-solved-easy-one-i-guess/#findComment-329888 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.