Jump to content

expression help


Destramic

Recommended Posts

hey guys im having  a problem with finding out if i string has the followeing...  a-z, 0-9, /, _, - and white spaces...im not sure why it is returning false when the charters in the  $uri variable are allowed characters...maybe a expression problem if anyone can help please on shy its not working...thank you

 

	
<?php protected function is_uri_friendly($uri)
{
$uri = "game/counter-strike/league/test";
        if (preg_match('#[^a-z0-9/-_]#i', $uri) > 0) {
                echo "$uri contain invalid characters\n"; 
        }else {
                echo "$uri DOES NOT contain invalid characters.\n";
        }

?>
}

Link to comment
https://forums.phpfreaks.com/topic/247747-expression-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.