You are here: Re: How do I use wildcards when searching in array? « PHP Programming Language « IT news, forums, messages
Re: How do I use wildcards when searching in array?

Posted by Chuck Anderson on 08/09/06 18:22

Phil Latio wrote:
> How do I use wildcards when searching in array? At least that's what I think
> I need !!
>
> I have the line:
>
> if ($attribute[0] != "id")
>
> The above is not 100% correct because it should also be looking for anything
> ending with id. eg. bookid or authorid aswell as just id.
>
> Should I be looking at regular expressions? I've never covered (well not
> knowlingly) regular expressions before and wouldn't know one if it came up
> and hit me around the face with a wet kipper.
>
> Could someone point me in the right direction.
>
> Cheers
>
> Phil
>
>
>
If you've described this accurately then

if (substr($attribute[0], -2) != 'id')

should work.


--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.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

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