You are here: Re: function call as an array « PHP Programming Language « IT news, forums, messages
Re: function call as an array

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!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация