game2002 Posted June 23, 2007 Share Posted June 23, 2007 Please help this newbie I have 3 files. 1 - declare_it.php //it contains an array like this: $bbSaved = array("Blue"=>100, "Red"=>0, "Green"=>50, "Yellow"=>2); 2 - gold_digger.php include("declare_it.php"); print "I have $bbSaved[blue] items<br>"; //this prints 100 after setting the value to 11 in reset_quantity.php, I print the value again. print "Final quantity for blue items: $bbSaved[blue] <br>"; // but it still prints 100 3 - reset_quantity.php include("declare_it.php"); print "Starting quantity for blue items: $bbSaved[blue] <br>"; //this prints 100 $bbSaved[blue] = 11; print "final quantity for blue items: $bbSaved[blue]<br>"; //this prints 11 the problem is: in file #2, gold_digger.php, when I print the quantity, it's always the original 100. I tried to put Global... I tried anything I can think of.. Just can't get it to print the new quantity. Can you help please. Thanks. Link to comment https://forums.phpfreaks.com/topic/56899-solved-help-cant-reset-variable/ Share on other sites More sharing options...
CoreyR Posted June 23, 2007 Share Posted June 23, 2007 unlink($variable); should work Link to comment https://forums.phpfreaks.com/topic/56899-solved-help-cant-reset-variable/#findComment-281119 Share on other sites More sharing options...
game2002 Posted June 23, 2007 Author Share Posted June 23, 2007 Thanks Corey but I don't understand. I am not trying to delete a file. How would link($variable) help? Link to comment https://forums.phpfreaks.com/topic/56899-solved-help-cant-reset-variable/#findComment-281122 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.