You are here: Re: How to avoid in_array() function. « PHP Programming Language « IT news, forums, messages
Re: How to avoid in_array() function.

Posted by R. Rajesh Jeba Anbiah on 12/05/05 06:10

Berimor wrote:
> Hi,
> i've been always used the in_array() function to check availabylity of a
> value in array. Until today. Simple code: (do not run it tho :) )
<snip>
> It prints the time script worked. Guess the number?
> 250(!!!!) seconds!!!
> Is there any alternative in PHP to check array?

IIRC, Ilia Alshanetsky, one of the PHP core developer and maintainer
blogged on this some time ago. According to him, isset() will be the
fastest; but for isset(), you need key.

FWIW, it's nice to see many people have now become optimization
advocates recently in c.l.php--a very rarest gesture some years ago:)

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

 

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

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