I have this url /store/cat1/pro4 I want it to remove the /pro4, so it becomes /store/cat1
Or
If I just could extract the /cat1 from the string
How can I do this?
I have this url /store/cat1/pro4 I want it to remove the /pro4, so it becomes /store/cat1
Or
If I just could extract the /cat1 from the string
How can I do this?
Here is a way to do it by spliting the string:
$url = "/store/cat1/pro4";
list($path,$store,$category,$product) = explode("/",$url);
echo $store; // store
echo $category; // cat1
echo $product; // pro4