Dell Sala wrote:
I think you want array_splice, not array_slice.

array_splice removes a section of an array an optionally replaces it with another array. It resets the keys of the array if it is numerically indexed. In your case, you leave out the replacement argument.

An example in your context might look like this:

array_splice($_SESSION['sessiondisplay'], $_SESSION['sessionviewpointer'], 1);

This would only makes sense if $_SESSION['sessiondisplay'] is a numerically indexed array, and if $_SESSION['sessionviewpointer'] is an int.

-- Dell

Thanks, I'll try that out as well and probably use it. The array is numerically indexed and the pointer is an integer. If I understand this right, my approach would then work on any array and any pointer. Good to know as well. :)

David
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to