Announcement

Collapse
No announcement yet.

array_splice? unset? which function is appropriate??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • array_splice? unset? which function is appropriate??

    can anyone tell me wat is the appropriate function to use for this situation??

    i have all my ids stored in session and when user clicked add, then it will add into the cart. i display the user cart in a table with checkboxes beside each row of record. when user clicked the checkbox and delete, it should delete the record.

    i've tried using unset(), but it doesn't work for my case. none of the records are able to delete. then i switch to array_splice. by using this array, i manage to delete, but there is a problem, which is if user clicked the middle record, not the first one, but clicked the middle record, then it will delete the first record instead of the middle record.

    i really donot know which function is approriate for me to use. i really need help on this. pls advice me..

  • #2
    unset($array['key']);

    is what you need, where key is the em array key like an ID
    Scott MacVicar

    My Blog | Twitter

    Comment

    Related Topics

    Collapse

    Working...
    X