fork download
  1. <?php
  2.  
  3. $url = 'http://w...content-available-to-author-only...e.com/files/2012/10/image001.png';
  4.  
  5. echo 'URL Parts:' . PHP_EOL;
  6.  
  7. echo PHP_EOL . 'And specific to path:' . PHP_EOL;
  8. echo parse_url($url, PHP_URL_PATH);
Success #stdin #stdout 0.02s 13064KB
stdin
Standard input is empty
stdout
URL Parts:
array(3) {
  ["scheme"]=>
  string(4) "http"
  ["host"]=>
  string(11) "website.com"
  ["path"]=>
  string(27) "/files/2012/10/image001.png"
}

And specific to path:
/files/2012/10/image001.png