I am trying to convert special characters (eg. +, /, &, %) which I will use them for a GET request. I have constructed a
+
/
&
%
You can use rawurlencode($url) builtin function.
rawurlencode($url)
the output:
http%3A%2F%2Ffb.com