I have this URL: http://itutormaths.hub/home/hub/6/hello/world and I want grab only hello and world.
How would I do this?
Thanks!
I have this URL: http://itutormaths.hub/home/hub/6/hello/world and I want grab only hello and world.
How would I do this?
Thanks!
<?php
$url = 'http://itutormaths.hub/home/hub/6/hello/world';
$pathParts = explode( '/', parse_url($url, PHP_URL_PATH) );
$lastParts = array( array_pop($pathParts), array_pop($pathParts) );
var_dump($lastParts);