In PHP, how do I search through a large string to see if it contains a smaller string?
June 12, 2007 11:09 AM
Subscribe
In PHP, how do I search through a large string to see if it contains a smaller string?
In PHP, I am opening a html file and reading in one line at a time. The problem is that I want to seach through the line to find a specific part.
For example.... I read in the following line into a variable called "$theData"
" >td height="19" bgcolor="#FFFFFF" width="140"<>font face="Arial, Helvetica" size=2<>a href="GenAvailGraph.php?id=510000054" target="_self"<5 10000054>/td<"
Now I want the search for "510000054" in $theData and return true or false depending on in the string has "510000054" contained in it.
Does anyone have any ideas on how to do this?>>5>
posted by kaozity to computers & internet (10 comments total)
$pos = strpos($theData, "510000054");
posted by bshort at 11:14 AM on June 12, 2007