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 266 views
2 answers 175 views
3 answers 260 views
2 answers 240 views
2 answers 177 views
177 views asked Jan 29, 2021 by avibootz
...