You are here: (Nevermind)Re: ereg or separator? « All PHP « IT news, forums, messages
(Nevermind)Re: ereg or separator?

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]


Удаленная работа для программистов  •  Как заработать на 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

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