i don't understand why this doesn't work.
I want to match
/games/(alphanumeric)/(alphanumeric) $SERVER[request_uri']
/games/(alphanumeric)/ $SERVER[request_uri']
/games/ $_SERVER[request_uri']
but so far with my code only the second one works.
if (preg_match("|games/([a-z]+)/([a-z,0-9]+)|",$_SERVER['REQUEST_URI']))
{
$css_main = ('../../../styles/css_main.css');
}
elseif (preg_match("|games/([a-z,0-9]+)|",$_SERVER['REQUEST_URI']))
{
$css_main = ('../../styles/css_main.css');
}
elseif (preg_match("|games|",$_SERVER['REQUEST_URI']))
{
$css_main = ('../styles/css_main.css');
}
Help please. 🙂