Is there any reliable way in PHP to clean a URL of anchor tags?
So input:
http://site.com/some/#anchor
Outputs:
http://site.com/some/
There is also one other option with parse_url();
$str = 'http://site.com/some/#anchor'; $arr = parse_url($str); echo $arr['scheme'].'://'.$arr['host'].$arr['path'];
Output: