Re: A cleaner way to do this?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Halliday wrote:

> 
> Is there any way to clean this up a bit?
> 

This is what I usually do:

if ( ($matches=preg_match(linepattern1,text,match))>0 )
{
// do stuff speicifc to linepattern1
}
else
if ( ($matches=preg_match(linepattern2,text,match))>0 )
{
// do stuff speicifc to linepattern2
}
else
if ( ($matches=preg_match(linepattern3,text,match))>0 )
{
}
else
if ( ($matches=preg_match(linepattern4,text,match))>0 )
{
}



-- 
Per Jessen, Zürich (15.9°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux