-1

My code:

$url = "https://www.example.com/reset_password/6f88e62e492ed288200b99b09f6d8132";
$para = $this->uri->segment($url);
echo $para;

In this code I only want the parameter that is passed in the url i.e 6f88e62e492ed288200b99b09f6d8132 but it's not working. How can I get only the parameter in php?

theduck
  • 2,589
  • 13
  • 17
  • 23
navi
  • 102
  • 1
  • 11

1 Answers1

0

Use explode function.

$url = $_SERVER["REQUEST_URI"];
$exploded_url = explode("/",$url);
$code = $exploded_url[1];
GrumpyCrouton
  • 8,486
  • 7
  • 32
  • 71
Marty1452
  • 430
  • 5
  • 19