munin
+ Reply to Thread
Results 1 to 4 of 4

Thread: Array Of Hope

  1. #1
    Join Date
    Aug 2007
    Posts
    122

    Array Of Hope

    Would any of you PHP programming geniuses happen to know of a PHP command to completely delete an array when it is no longer needed?

    Suppose I created an array:

    Code:
    $items = array();
    
    $items[0] = "*st Item";
    $items[*] = "2nd Item";
    $items[2] = "*rd Item";
    After using the array for something and never needing to access it again, is there a way to simply remove it completely and as totally as if it had never been defined?

    I know I can remove individual items, but I simply want to delete the entire array completely.

    I can't seem to find such a command, if there is one.

    There is an array of 54 items I use in a program I'm working on. Once I extract and process all the items from it, I simply want to completely delete or remove the array and recover whatever resources it used. That's all.


    .
    Oh to be free, so blissfully free, of the ravages of intelligence, there is no greater joy! - The Cweationist's Cweed

    All that is necessary for evil to triumph is a good PR firm.
    Very funny, Scotty. Now beam down my clothes!

  2. #2
    Join Date
    Sep 2006
    Posts
    32
    Well if you were using C you could do malloc() and free(), but I don't think php has anything similar. Try looking for a PHP delete() function.

  3. #3
    Join Date
    Aug 2007
    Posts
    122

    PHP Designers Should Be In Gitmo With The Other Terrorists

    Quote Originally Posted by tocksarcle View Post
    Well if you were using C you could do malloc() and free(), but I don't think php has anything similar. Try looking for a PHP delete() function.

    I did.

    The PHP manual said:

    Description
    void delete ( void )

    This is a dummy manual entry to satisfy those people who are looking for unlink() or unset() in the wrong place.

    Return Values
    No value is returned.



    Apparently it's unlink or unset

    Of course it wouldn't be anything logical like a normal person would think of - like delete.

    LOL


    Found it:

    it is

    Code:
    unset($ArrayName);
    of course, to delete a file it's
    Code:
    unlink($FileName);

    Why can't they use language that relates to the real world and the way people think?


    To whoever invented those counterintuitive function names in PHP:
    Slap, kick, punch, spit, bite!

    May the fleas of *0,000 camels have a family re***** in your shorts!
    Last edited by JayT; 09-27-2007 at 10:52 PM.
    Oh to be free, so blissfully free, of the ravages of intelligence, there is no greater joy! - The Cweationist's Cweed

    All that is necessary for evil to triumph is a good PR firm.
    Very funny, Scotty. Now beam down my clothes!

  4. #4
    Join Date
    Sep 2006
    Posts
    1,649
    Quote Originally Posted by JayT View Post
    May the fleas of *0,000 camels have a family re***** in your shorts!
    I really gotta use that one next time I'm pissed
    "Workers of the world unite; you have nothing to lose but your chains." -Karl Marx

+ Reply to Thread

Similar Threads

  1. i hope to see it
    By saudi good good in forum General discussion
    Replies: 18
    Last Post: 02-25-2009, 04:23 PM
  2. Array of Hope
    By JayT in forum Programming
    Replies: 9
    Last Post: 03-25-2008, 04:49 PM
  3. Input text file to array help
    By Deadvacahead in forum Programming
    Replies: 0
    Last Post: 12-06-2007, 08:56 PM
  4. i hope this is the appropriate place to post this
    By joefro4568 in forum Programming
    Replies: 0
    Last Post: 08-18-2007, 09:01 AM
  5. i hope you can help me
    By ferdelgadillo13 in forum Internet Privacy
    Replies: 3
    Last Post: 01-17-2007, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts