Remove all before certain delimiter starting at end of string PHP
Hey, I need help isolating part of a url in PHP.
开发者_Go百科say I have
http://www.test.com/something/something/important/
How could I isolate the "important"
Thanks!
Use the basename() function for that.
echo basename('http://www.test.com/something/something/important/');
Result:
important
<?php
$url ='http://www.test.com/something/something/important/';
echo basename($url);
?>
精彩评论