Anybody knows please help!
<script type="text/javascript" language="javascript">
var a = 3;
document.write("<?php funct1('"+a+"') ?>");
</script>
<?php
function funct1($param){
$param = preg_replace('/\s+/', ' ', $param);
echo intval($param);
}
?>
I used to pass js variable to php in the same page this way, it works, but I want that variable : ($param from a) to return it value as integer. whenever i use (int)$param or intval($param) then it returned 0. tried preg_replace
to replace space, it still not solve.
Thanks for help.