I need to get second last word of a url which is split by "/"
.I have tried
$refer_split = explode("/", $refer);
echo $refer_split[6];
but it is not working in case of small urls. please suggest a good way to find the secondlast word in php