LuboEM LuboEM - 1 year ago 85
PHP Question

Get URL code not the whole URL

my php function is

<?php $exp3 = $_GET["url"];
echo $exp3;

This function gets me this link for example

What do I need is to transform this function to get just the code of the url. In this case its 687aa15fe046f21cc1e3.

Can you please help? Thank you

Answer Source

You can use explode and get the last

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

 echo $my_last;