manalnor Posted August 14, 2011 Share Posted August 14, 2011 Hello friends, if we have $id = 39827-key1-key2-key3 and we want to show only the number or anything before (-) then by using $realid = array_shift(explode("-", $id)); we will get echo $realid; // 39827 Now my problem is as following ! if we have $id = key1/key2 and i want on something that remove the whole part key1/ and gives me only key2 how can i do it Quote Link to comment https://forums.phpfreaks.com/topic/244753-clearing-the-link-id/ Share on other sites More sharing options...
trq Posted August 14, 2011 Share Posted August 14, 2011 array_pop(explode("/", $id)); Quote Link to comment https://forums.phpfreaks.com/topic/244753-clearing-the-link-id/#findComment-1257124 Share on other sites More sharing options...
manalnor Posted August 14, 2011 Author Share Posted August 14, 2011 @thorpe Works perfect Thanks a lot it is very helpful to me to increase my website seo links Quote Link to comment https://forums.phpfreaks.com/topic/244753-clearing-the-link-id/#findComment-1257127 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.