Forum Moderators: coopster
In the cms im developing, it is supposed that the article can be translated from english to french if i do this:
/about_us/employees/_fr
or to spanish if i do this:
/about_us/employees/_es/
note that it must be recognized be with or without the final '/'... i've setup an htaccess file which delivers all the data to index.php, which handels the REQUEST_URI variable.
So, i need to make a regular expression check to the REQUEST_URI variable to see if someone typed _XX or _XX/ at the end of it.
Help?
<?
$d[] = '/about_us/employees/';
$d[] = '/about_us/employees/_fr';
$d[] = '/about_us/employees/_es/';
$d[] = '/asdasd/asd~asd/sdds';
$d[] = '/about_us/employees/_ES/';
$d[] = '/about_us/employees/_Es/';
foreach ($d as $val){
if (eregi("_[a-z]{2}/{0,1}$",$val)) echo "$val: matched<br>";
else echo "$val: not matched<br>";
}
?>