I thought of using preg_match and eregi but I'm not sure how to go about it. I've haven't coded in PHP in over a few years so a lot of the knowledge has been forgotten.
This is what i have so far..
CODE
<?php
//http://mywebsite.com/cat/sub/file.php
$querys = explode("/",$_SERVER['REQUEST_URI']);
foreach($querys as $q_item){
if(eregi("(.*).php?",$q_item)){
$term = explode(".",$q_item);
$search_terms .= $term[0] . ": ";
}else{
$search_terms .= $q_item . " ";
}
}
?>
Output:cat sub file
//http://mywebsite.com/cat/sub/file.php
$querys = explode("/",$_SERVER['REQUEST_URI']);
foreach($querys as $q_item){
if(eregi("(.*).php?",$q_item)){
$term = explode(".",$q_item);
$search_terms .= $term[0] . ": ";
}else{
$search_terms .= $q_item . " ";
}
}
?>
Output:cat sub file
I've tried looking it up on google and and this site, but i haven't found anything in quite a while.
Any help and advice would be appreciated. Also any recommendations on good regex sites would be a plus.