Jump to content

Recommended Posts

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"

Link to comment
https://forums.phpfreaks.com/topic/65970-solved-easy-one-i-guess/
Share on other sites

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!!!!

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.

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.