Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object data wont save within a self calling function

Status
Not open for further replies.

pollux0

IS-IT--Management
Joined
Mar 20, 2002
Messages
262
Location
US
I am trying to save the data in an object that is located in a function that calls itself a variable number of times. I cant seem to capture all the data in the object, When the function is called a second time, the data in the object is erased(i think). I also need to return the object back to the main script. The object is "$myarray". Any advice?
********************
function doThis($this_part,$x,$whichLayer,$constantNumber,$myarray){
$myarray[$constantNumber]->subtype = findIt($this_part);
$myarray[$constantNumber]->layer = $whichLayer;
$whichLayer=$whichLayer+1;
$constantNumber=$constantNumber+1;
for ($x = 0; $x < count($this_part->parts); $x++) {
doThis($this_part->parts[$x],$x,$whichLayer,$constantNumber,$myarray);
}
}

for ($x = 0; $x < count($structure->parts); $x++) {
$whichLayer=1;
$constantNumber=0;
doThis($structure->parts[$x],$x,$whichLayer,$constantNumber,$myarray);
}
********************
thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top