[UPHPU] need regex help

District Webmaster webmaster at alpine.k12.ut.us
Wed Oct 13 10:38:42 MDT 2004


Hello all,

I need to determine if a string contains any one of a group of
characters. A cludgy way to do it would be:

if (strpos($string, "a") !== false ||   $string, "b") !== false ||
$string, "c") !== false) {
    //do something
}
else {
    //do something else
}

but there has got to be a more elegant, regex  way to do this . . .

Dave



More information about the UPHPU mailing list