xbl1 Posted September 8, 2007 Share Posted September 8, 2007 Hi;i have problem to use the split(), i got a url value of string from the address bar.and i want to get the last part of the url value by using the split(), but i could not do it, could you help, please.the url value from the address bar format is;/shoppingand i want to take the "/" off and keep the remainsmy code as following; <?php$category= $_SERVER['REQUEST_URI'];echo $category;list($cat)=split('[/]', $category);echo $cat;?> echo $cat does not print out anything. Link to comment Share on other sites More sharing options...
Synook Posted September 8, 2007 Share Posted September 8, 2007 You could do that with str_replace() $cat = str_replace("/", "", $category); With the split(), try list($blank, $cat)=split('/', $category); Link to comment Share on other sites More sharing options...
xbl1 Posted September 8, 2007 Author Share Posted September 8, 2007 You could do that with str_replace()$cat = str_replace("/", "", $category); With the split(), try list($blank, $cat)=split('/', $category); Thanks, both all work for me. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.