Hi Readers!
If you having a useful URL and want to extract the specific part from it you learn the logic below
Lets have a example
$yoururl = "http://www.abc.com/usefulinfo/";
Here I'm getting only the /usefulinfo/ word. For getting this you just need to explode $yoururl
$usedpart = array_filter(explode("/",parse_url($yoururl,PHP_URL_PATH)));
and now you can echo the useful part of you URL
echo current($usedpart);//usefulinfo
0 Comment(s)