I have the next situation:
$a = ' 0226 ';
I'm trying to remove whitespaces from the beginning and end of the string:
print_r(trim($a));
and expected output is:
'0226'
Here are results of var_dump
and urlencode
of above string:
print_r(urlencode($a)); // %C2%A0+0226+%C2%A0
var_dump($a) // <pre class='xdebug-var-dump' dir='ltr'><small>string</small> <font color='#cc0000'>' 0226 '</font> <i>(length=10)</i>
</pre>