Posted by Toby A Inkster on 04/25/07 09:08
Rami Elomaa wrote:
> If it indeed is the first element, then you can use reset (and for the last
> element end) but there is no such functionality for returning the n'th
> element.
>
> echo reset(functioncall());
If you need the nth item, it's fairly easy to write your own function to
do this:
function array_n($array, $n) { return $array[$n]; }
echo array_n(functioncall(), 2);
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|