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]
|