how to properly encode urls in php