You are here: Re: [PHP] asterix for arrray_search? « PHP « IT news, forums, messages
Re: [PHP] asterix for arrray_search?

Posted by "Richard Lynch" on 06/18/05 23:32

On Sat, June 18, 2005 10:11 am, Merlin said:
> I am trying to find out how to match a search on : 5a or 5b with array
> search.
> Basicly I would like to make it true as soon as the function finds a value
> starting with 5.
>
> As for now I have:
> if (array_search('5a', $emsg) OR array_search('5b', $emsg)){
> ...
>
> that statement will get very long till z :-)
>
> Any ideas how to make something like this:
> array_search('5*', $emsg)

I believe that in recent versions of PHP, the preg_* functions will accept
an array as an argument... Or maybe I dreamed that.

You should benchmark the solutions and also consider just using implode()
on the array to make a giant string and search that.

Depending on a lot of factors, any of these could out-perform the others.

Try it with data as close to real-world as you can get.

--
Like Music?
http://l-i-e.com/artists.htm

 

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

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