Among other differences, urlencode
and rawurlencode
encode spaces differently. +
and %20
resepctively. According to the PHP docs, variables are decoded automatically. How does PHP “know” which way to decode it?
I used to use urlencode
until I read here on SO that the raw counterpart is generally better. I must say, I've never run into any decoding problems but am curious as to how it works and if you think there are any scenarios when rawurlencode
would cause issues due to the automatic decoding.
Thanks.