-1

say my URL is:

someplace.com/mydata

How can I get the mydata from the URL ?

Example, If I visit facebook.com/alshahrior it's show my fb profile. How can I do that using PHP ?

1 Answers1

1

You can do that with parse_url

<?php
$url = "http://someplace.com/mydata";

echo parse_url($url, PHP_URL_PATH);
Wouter075
  • 134
  • 6