Forum Moderators: coopster
urlencode breaks (encodes) slashes
<?php
$s = 'http://www.example.com/web/xhtml/application-xhtml+xml';
echo '<a href="?url='.urlencode($s).'">this page with ?url='.$s.'</a>';
$url = $_GET['url'];
if (!empty($url)) {
echo '<br><br>$_GET[\'url\'] was: '.$url;
echo '<br><a href="'.htmlentities($url).'">Go There</a>';
}
?>
By default it replaces plus signs with spaces however to the best of my knowledge plus signs are not a separator...
%20). If you want to actually have a plus sign in your URL then it must be encoded.
urlencode('+') = '%2B'