从像urplace / mydata这样的网址捕获数据我想要捕获mydata

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 ?

You can do that with parse_url

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

echo parse_url($url, PHP_URL_PATH);