<?php
// Call PHP function from javascript without ajax

function myphpfunction($b) {
  echo "aa ".$b;
  }
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>PHP & Javascript</title>
<script type="text/javascript">
   console.log("<?php echo myphpfunction("aya")?>");
</script>
<?php

var_dump($_COOKIE);
?>
</head>
<body>
</body>
</html>