Passing get parameter from javascript to php destroys formatting -
i format text javascript asigning +
every emtpy space this
var ft = text.replace(/ /g,"+");
then pass ft
php script via jquery ajax argument.
but
print $_get['text'];
gives me text empty spaces instead +.
any ideas?
you should familiar concept of url encoding.
php's urldecode
function run against $_get
variables default, if want see raw input, use rawurldecode
:
$encoded = array_map('rawurldecode', $_get); echo $encoded['text']; //blah+blah
Comments
Post a Comment