SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member Flanker's Avatar
    Join Date
    Apr 2006
    Location
    Paris, France
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [ASK] how to delete array

    I have performance problem with my AJAX.

    because it's multi user and run on 800mhz and 256MB windows 2000 server.

    I need to delete arrays.

    how to do that ? can I use :

    Code:
    delete $nameofarray;
    or should I delete the element one by one ? which one is better ?

    using:
    Code:
    delete $nameofarray[0];
    or
    Code:
    $nameofarray = undefined;
    Can I improve the performance by doing this ?

    I am sorry I don't know much about memory allocation and good programming practice

    thank you very much.

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you using Javascript or PHP? You can set javascript variables/arrays to null to get rid of them.


Bookmarks

Posting Permissions

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