call php function inside php file code example
Example 1: call php function in js
<script>
var phpadd= <?php echo add(1,2);?> //call the php add function
var phpmult= <?php echo mult(1,2);?> //call the php mult function
var phpdivide= <?php echo divide(1,2);?> //call the php divide function
</script>
Example 2: execute function php
function functionName() {
//code to be executed;
}
functionName();