How to encode URL string in PHP

2 Answers

0 votes
echo urlencode('http://www.collectivesolver.com/');
 

/*
run: 

http%3A%2F%2Fwww.collectivesolver.com%2F 

*/

 



answered Jul 22, 2016 by avibootz
0 votes
echo htmlentities(urlencode('http://www.collectivesolver.com/7706/how-to-encode-url-string-php'));
 

/*
run: 

http%3A%2F%2Fwww.collectivesolver.com%2F7706%2Fhow-to-encode-url-string-php 

*/

 



answered Jul 22, 2016 by avibootz

Related questions

2 answers 254 views
2 answers 164 views
3 answers 245 views
2 answers 224 views
2 answers 168 views
168 views asked Jan 29, 2021 by avibootz
...