Jump to content

Stripping &*()_+ and other charactors.


aximbigfan

Recommended Posts

you could do this on the callback (PHP side) depends on the code..

 

<?php
$data = "hello & world";
$data = rawurlencode($data); // hello%20%26%20world
echo $data;
?>

 

then on the javascript side use decodeURIComponent

ie

<script type="text/javascript">
var test1="hello%20%26%20world";
document.write(decodeURIComponent(test1));
</script>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.