You are here: [suspicious - maybe spam] Re: [PHP] How do I get the first element's key of an array of objects? « PHP « IT news, forums, messages
[suspicious - maybe spam] Re: [PHP] How do I get the first element's key of an array of objects?

Posted by Mattias Thorslund on 04/08/05 03:19

Chris W. Parker wrote:

>While looking through the array functions I saw www.php.net/array_keys
>and thought of:
>
><?php
>
> $keys = array_keys($object_array);
>
> $first_key = $keys[0];
>
>?>
>
>

I wonder if that will work, when the first element has the key 3... ?

This might work better:

$keys = array_keys($object_array);
$first_key = reset($keys);

/Mattias



--
More views at http://www.thorslund.us

 

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

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