I’m trying to make PHP respond onClick of a button the game I’m making has tons of buttons and the way I found it online is too long how do I do it in less than 3 lines?
My code so far
<?php
$coins = 123423142134234;
function foo() {
$coins = 4321;
echo $coins;
}
?>
<button onclick="<?php foo(); ?>">yo</button>