If i want to get the extension of a URL with pathinfo function, i do this:
<?php
$path_parts = pathinfo($url);
echo $path_parts["extension"];
?>
And what’s my surprise that Apache shows the following notice:
Notice: Undefined index: extension in ...
How can i deal with it?
Thanks.
If you want to get only extension use this: