I am wondering how to access object properties from an object created in a parent PHP file. For instance this code is in Main.php:
if ($XML->Data['Items'][$PART_NUM]['Total_Qty'] > 0) {
$this->Item[$Item['PART_NUM']]['Stock'] = "{$XML->Data['Items'][$PART_NUM]['Total_Qty']} in Stock";
} else {
$this->Item[$Item['PART_NUM']]['Stock'] = "OUT OF STOCK";
}
and $XML is an object created in index.php using a class defined in XML.php. Main.php and XML.php are both included in index.php
How can I access the $XML object inside Main.php when it was created in index.php?
Thank you for any help possible.
Tom 🙂