First off, I greatly appreciate anyone willing to help.Something very odd is happening in my script. When I compare two variables that match it is supposed to say hiya. I am sure that both variables match, however , hiya is never echoed.😕 does anyone have an answer to this?
And here is where you can see the source:
findtest.php:
<?
$times=0;
//sets the function that runs through the article DB
function check($section_num, $this_row, $times)
{
$indexed = "indexed.php";
$filename="$indexed";
$file=fopen($filename, "r");
$contents=fread($file, filesize("$filename"));
$this_row = explode('*/*', $contents);
$section_num = count($this_row);
if($times <= $section_num)
{
$this_column = explode('|', $this_row[$times]);
$looking_for=scinews;
if($this_column[0]==$looking_for)
{
echo "hiya<br>";
$times++;
check($section_num, $this_row, $times);
}
else
{
echo "$looking_for does not equal $this_column[0]<br>";
$times++;
check($section_num, $this_row, $times);
}
}
}
check($section_num, $this_row, $times);
?>
indexed.php:
scinews4|ME ME ME|hello
*/*
scinews3|ME ME ME|hello
*/*
scinews10|ME ME ME|hello
*/*
scinews|ME ME ME|hegdfsdasasdfo
*/*
scinews9|ME ME ME|hello
*/*
scinews1|ME ME ME|hello
Any help would be appreciated.. THX, Morgan