すみません、クダ質ですが
echo "<input type=\"hidden\" value=\"htmlspecialchars($_POST['var'])\" />";
っていう表現、できないんでしょうか?