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

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -