hi,

i am trying to do a check using the in_array function. everyhting works fine when there are no special characters in the "needle" portion (ex: in_array($needle, $haystack) )

i have a few "needles" that have special characters and anything past them in the array doesnt get checked.

the retrieval and check are both done inside of the script. nothing is getting passed through the browser.

currently, we have ' , / in some of the "$needles" so i need to know how to get it to recognize these as parts of that needle and keep going through the array.

thank you.

    Can you give me a more specific example of a difficult needle?

    My test:

    <?php
    
    $myray=array("foo", "bar, qux", "'", "/", "baz'");
    
    if (in_array("baz'", $myray)) {
       echo "Yup\n";
    }
    ?>
    

    ... seemed to work normally.

      thanks for the example.

      i see what i was doing wrong.

      i didnt have the feilds in the array in quotes. that was giving me the errors.

      seesm fine now.

      thank you

        Write a Reply...