sending js variable to php file code example Example: how to use php variable in javascript file <?php $bool = false; $num = 3 + 4; $str = "A string here"; ?>