Jump to content

andy3367

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

andy3367's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I thought it should work, too, but it doesn't. Very odd. And yeah, the example does pass "sstring" as the parameter. Oh well, I'll just delete the offending function and move on. FYI, the website hosting my programs uses "PHP 5.2.*" so I don't know what's up. Maybe I'll email them... Thanks for the reply.
  2. I'm quite new to PHP, and am trying to follow a book example of something. The sample code in the book includes the following snippet: $names = array ("Lee Marvin","Joe Smith","John Doe"); if (!in_array (strtolower ($_GET['sstring']), strtolower($names))){ //Then return with an error. ?><span style="color: #FF0000;">Name not found...</span><?php } else { //At this point we would go to the processing script. ?><span style="color: #FF0000;">Form would now submit...</span><?php } This code returns the error, "Warning: in_array() [function.in-array]: Wrong datatype for second argument," in reference to the in_array statement. If I remove the second strtolower function, all works well. So my question is, how do I do the case conversion on the array to ensure proper matching? The idea of the code is to allow LEE MARVIN, lEE marVin, etc., to match with Lee Marvin. Help and thanks.
×
×
  • 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.