Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unexpected Output

Status
Not open for further replies.

disord3r

Programmer
Apr 12, 2002
189
US
Wondering why the following block of code has no output:

$string = "fdsafs | fdsfdsafs";
if (strstr("|", $string))
{
echo "!";
}

I've tried using chr(124) instead of the pipe character, and I've also tried escaping the pipe in case it can't be used like that. In any case, the echo statement never executes. Any ideas?
 
N/M. It was something simple. The haystack goes before the needle in this case. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top