获取URL代码,而不是整个URL


Get URL code not the whole URL

我的PHP函数是

$exp3 = $_GET["url"]; 
echo $exp3;

这个函数得到这个链接,例如

"http://www.streamuj.tv/video/687aa15fe046f21cc1e3"

我需要的是转换这个函数来获得url的代码。在这个例子中是687aa15fe046f21cc1e3

你能帮帮我吗?谢谢你

你可以使用爆炸来获取最后一个

  $myArray= explode('/',$exp3 );
  $my_Last = end($myArray);
 echo $my_last;

你可以这样做:

$code = array_pop(explode('/', $exp3));
echo $code;