todayme Posted March 2, 2007 Share Posted March 2, 2007 I am not formiliar with PHP do you need to wip an array from memory after use, or does the language do it its self? If you do have to wip the array so as not to keep a hold of memory how would you do it? Link to comment https://forums.phpfreaks.com/topic/40820-remove-array-from-memory/ Share on other sites More sharing options...
itsmeArry Posted March 2, 2007 Share Posted March 2, 2007 use unset($array); Link to comment https://forums.phpfreaks.com/topic/40820-remove-array-from-memory/#findComment-197639 Share on other sites More sharing options...
todayme Posted March 2, 2007 Author Share Posted March 2, 2007 use unset($array); Do you have to do this with variables as well? Link to comment https://forums.phpfreaks.com/topic/40820-remove-array-from-memory/#findComment-197640 Share on other sites More sharing options...
simcoweb Posted March 2, 2007 Share Posted March 2, 2007 Check this out: http://us3.php.net/unset Link to comment https://forums.phpfreaks.com/topic/40820-remove-array-from-memory/#findComment-197642 Share on other sites More sharing options...
itsmeArry Posted March 2, 2007 Share Posted March 2, 2007 yup u can do it with array or variables both Link to comment https://forums.phpfreaks.com/topic/40820-remove-array-from-memory/#findComment-197645 Share on other sites More sharing options...
btherl Posted March 2, 2007 Share Posted March 2, 2007 When your script finishes, all memory used by it will be freed. So for most scripts, you will not need unset() Also, variables created and used inside a function will be freed at the end of the function (unless you have made them accessible outside the function, by returning them or putting them in a global variable) Usually I only consider unset() if my script actually does run out of memory. Link to comment https://forums.phpfreaks.com/topic/40820-remove-array-from-memory/#findComment-197651 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.