PHP: URL Encoding -


i have 2 files: test.php , test.html same content

 <meta charset="utf-8">  <script>      document.write(encodeuricomponent(';²'));  </script> 

output php %3b%3f , html %3b%c2%b2. how can same result php? how can transform %3b%c2%b2 using php functions?

you can use urlencode() function

echo urlencode(';²'); 

above function outputs %3b%c2%b2


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -