Need help with this code
Posted: Fri Jun 03, 2005 12:45 am
Code: Select all
$template2 = file('template.txt');
$numcount=0;
foreach ($template2 as $v1) {
print "e;testing"e;;
if ($v1=="e;/##"e;)
{
$key = $numcount;
print "e;numcount is "e;.$numcount;
break;
}
$numcount++;
}In that file, I have a line like this
htmlcode
/##
code to be replaced
##/
I made sure there were no other instances of /## and ##/ other than in the middle of the file, and that there are no spaces before or after them.
However, with this code /## is never found and the end of file is reached.
I see a whole bunch of "testing" but not a single "numcount is.."