That is because if you issue something like
<INPUT TYPE="HIDDEN" NAME="myvar" VALUE="<?php echo $myvar>">, the result in the browser will be
<INPUT TYPE="HIDDEN" NAME="myvar" VALUE="24 " dia"> which does not make much sense.
You should use something like
<INPUT TYPE="HIDDEN" NAME="myvar" VALUE="<?php echo htmlentities($myvar)>">, which will replace '"' with " .
Cheers,
Ben