I want to run a PHP function with an HTML button click.
I can call a PHP script this way:
Name
This won't work. PHP is pretty much done processing by the time the user handles the page. You'd have to use AJAX to send the data to the server and retrieve the response.