drupal_urlencode($text)
drupal-cvs/includes/common.inc, line 2644
Wrapper around urlencode) which avoids Apache quirks.
Should be used when placing arbitrary data in an URL. Note that Drupal paths are urlencoded() when passed through url() and do not require urlencoding() of individual components.
Notes:
$text String to encode
<?php
function drupal_urlencode($text) {
if (variable_get('clean_url', '0')) {
return str_replace(array('%2F', '%26', '%23', '//'),
array('/', '%2526', '%2523', '/%252F'),
rawurlencode($text));
}
else {
return str_replace('%2F', '/', rawurlencode($text));
}
}
?>