There are better ways of doing this than using unset, such as using http://us2.php.net/manual/en/function.array-pop.php for example. I still say brushing up on arrays is the only way to learn and I’ll go even one further reading up on the php language (or any programming language) is the BEST way to go. Get a current book or current tutorial is my advice.
[php]<?php
//http://us1.php.net/manual/en/book.array.php —> I suggest you go here to learn about arrays.
$za = array(‘1’ => ‘teeest-1’, ‘2’ => ‘teeest-2’);
$zm = $za[1];
echo '$za array start: ’ . print_r($za, 1) . ‘
’;
//unset($za[2]);
$last = array_pop($za);
echo '$za array after pop: ’ . print_r($za, 2) . ‘
’;
echo '$last value of array $za: ’ . print_r($last, 2) . ‘
’;[/php]
To me unset by reference gets to confusing, but that is just my opinion. Specially when you can manipulate arrays very easily will all different type of function calls php offers. 