SyntaxFix
Write A Post
Hire A Developer
Questions
Try this it will work fine.
<script> function echoHello(){ alert("<?PHP hello(); ?>"); } </script> <?PHP FUNCTION hello(){ echo "Call php function on onclick event."; } ?> <button onclick="echoHello()">Say Hello</button>