I have the following:
function lookupaddress($maildatabasefile, $ticket){
$filename = "$maildatabasefile";
$fp = fopen($filename, "r");
$maildatabase = fread($fp, filesize($filename));
fclose($fp);
$maildbrow = explode(";", $maildatabase);
while($i <= sizeof($maildbrow)) {
$dbrowcontents = explode(":", $maildbrow[$i]);
if ($dbrowcontents[0] == "$ticket"){
$emailaddress = $dbrowcontents;
break;
} else {
$emailaddress = "NO ADDRESS";
}
$i++;
}
return $emailaddress;
}
the file it reads contains
1:user@domain1.com;
2:dog@cat.com;
3:user@domain2.com;
it should return the email address (right of the 🙂 of the line that contains the ticket (number left of the 🙂
Any idea why it doesn't?
Edit: Made a few changes, though same problem.