rawurlencode - Encodes the given url string
string rawurlencode ( string $str )
$str - The URL string to be encoded.
Returns a string in which all non-alphanumeric characters except dot (.), dash (-) , underscore (_) and tilde (~) have been replaced with a percent (%) sign followed by two hex digits.
<?php
$str = 'raw url encode';
echo "http://example.com/?param=" . raurlencode( $str );
?>
http://example.com/?param=raw+url+encode