Please help,
I am trying to call a php function from an external php file into the javascript. My code is different and large.So i am writing a sample code here.
This is my php code
<?php
function add($a,$b){
$c=$a+$b;
return $c;
}
function mult($a,$b){
$c=$a*$b;
return $c;
}
function divide($a,$b){
$c=$a/$b;
return $c;
}
?>
This is my javascript code
<script>
var phpadd= add(1,2); //call the php add function
var phpmult= mult(1,2); //call the php mult function
var phpdivide= divide(1,2); //call the php divide function
</script>
So this is what i wanna do. My original php file doesnt include these mathematical functions but the idea is same.
If somehow it doesnt have proper solution then please suggest me the alternative but it should call values from external php.
Please Help!!