function retrieve_email($datatype, $id) {
global $projectFolderPath;
switch (strtolower($datatype)) {
case 'xml': // RETRIEVE FROM XML
$fileID = @fopen("$projectFolderPath/xml/email.xml", 'r');
if ($fileID) {
$xml = @fread($fileID, filesize("$projectFolderPath/xml/email.xml"));
@fclose($fileID);
$parser = @xml_parser_create();
if ($parser) @xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); // SKIP WHITESPACE IF FOUND
@xml_parse_into_struct($parser, $xml, $xmlArray, $tags);
@xml_parser_free($parser);
for ($i = 1; $i < @sizeof($xmlArray); $i++) {
if ((int)$id !== 0 && (int)$xmlArray[$i]['attributes']['ID'] === (int)$id) {
return 'ffff';
}
}
return null; // NOT FOUND
}
case 'db': // RETRIEVE FROM DATABASE
break;
case 'file': // RETRIEVE FROM OTHER FLAT FILE
break;
case 'session': // RETRIEVE FROM SESSION
break;
default: // DO NOTHING
break;
}
}
I have tested this by using placed print_r() statements in strategic locations to verify that the for loop is being iterated, however, no return ever takes place no matter the value returned.
I can't figure this out and it's due in hours, please help!
Thanx
Phil