print_r("From index.php 20: $prefix: stateXML = $stateXML<P>");
foreach (array('state', 'country') as $prefix) {
print_r("From index.php 21: stateXML = $stateXML<P>");
${$prefix . 'XML'} = $this->getXML($prefix . '.xml');
}
I have never seen anything like this in my 3+ years of PHP coding!
When I ran this code, I get the following output:
From index.php 20: : stateXML =
From index.php 21: stateXML = state
How on earth did $stateXML get set, there is literally NOTHING that
sets it!!! Here is the method getXML():
function getXML($xmlFileName) { // XML STRING METHOD
global $DOCUMENT_ROOT, $devpath, $basePath;
$path = "$DOCUMENT_ROOT$devpath/image_catalog";
if (!$xmlFileName || !file_exists("$path/xml/$xmlFileName"))
die("$path/xml/$xmlFileName does not exist");
$fileID = @fopen("$path/xml/$xmlFileName", 'r') or
die("$path/xml/$xmlFileName could not be found");
if (!$fileID) return '';
$xmlStuff = fread($fileID, filesize("$path/xml/$xmlFileName"));
fclose($fileID);
return $xmlStuff;
}
Again, how is $stateXML existing when there is clearly NO reason for
it to ever exist??
Help!
Phil