|
Posted by Max on 10/10/09 11:24
I figured out that you can use | to separate them. So $domains =
"$domain1.com|$domain2.com|$domain3.com".
Seems to work fine so far.
Thanks,
Max
"Max" <max@max.com> wrote in message
news:NflNe.25843$Fd1.3386@fe07.news.easynews.com...
> Is there a way to separate text in an ereg statement so that it is checked
> against separately?
>
> In other words, I've got the following:
>
> $domains = "domain1.com domain2.com domain3.com";
>
> if (ereg($domains, $variable)) do whatever...
>
> Is there any separator that I can place in between the various domains, so
> that the ereg statement will check if any of the domains is in $variable?
> As is, it checks the entire string with the spaces.
>
> I know I can explode $domains, and have multiple ereg checks in the
> statement like if ereg($domains[0],$variable) || ereg($domains[1])...etc,
> but I'm looking to avoid this so I can have an infinite number of domains.
>
> Is this possible?
>
> Thanks,
> Max
>
Navigation:
[Reply to this message]
|