This is an old version of this answer!
Return to the current answerYou will need to get the absolute path. We can check the URL againts the siteurl configured. Try this code:
$file_path = parse_url("http://www.informatik.com/themeforest/test/wp-content/uploads/2011/12/home18.jpg");
$siteurl_path = parse_url(site_url());
$file_path = ltrim(str_replace($siteurl_path['path'], '', $file_path['path']), '/');
Jeffri Hong | 05/18/12 at 4:31pm
