preg match - PHP preg_match using 'or' delimiter -
i'm trying match string of url using preg_match
need match either 1 or other string , can't find correct syntax.
what i'm using is:
$is_url_en = preg_match ("/\b95\b/i", $iframeurl);
this searches number "95" in url. want match "en" don't know how use 'or' delimiter. i've seen somewhere following:
$is_url_en = preg_match ("/\b95\b/i|/\ben\b/i", $iframeurl);
...but doesn't work. hints please?
don't repeat /
, /i
. delimit regex should there once.
$is_url_en = preg_match ("/\b95\b|\ben\b/i", $iframeurl);
you simplify to:
$is_url_en = preg_match ("/\b(95|en)\b/i", $iframeurl);
Comments
Post a Comment