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 274 views
2 answers 181 views
3 answers 272 views
2 answers 249 views
2 answers 185 views
185 views asked Jan 29, 2021 by avibootz
...