You are here: Re: Regular expression to compare two variables similar to SQL: field LIKE 'value%' « PHP Programming Language « IT news, forums, messages
Re: Regular expression to compare two variables similar to SQL: field LIKE 'value%'

Posted by Andy Jeffries on 10/18/05 14:02

bissatch@yahoo.co.uk wrote:
> I am trying to compare two variable but using regular expression:
>
> $access = "glasgow"
>
> $areaid = "glasgow-westend-byers_rd"
>
> using the two variables, I would like the areaid variable to be
> compared with the access variable. the regular expression function will
> return true if $access matches the start of $areaid. So the two above
> would return true

if (ereg("^$access", $areaid)) {
// ... do something
}

Cheers,


Andy

 

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

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