Your HTML is viewed in a client (browser), and the function you want is in PHP on the server.
You basically have 2 options on how to do this:
1. Place your button within a FORM to be processed on the server
2. Call a javascript function which utilizes AJAX to call the server script for processing.
Reference:
html - How to call a PHP function on the click of a button - Stack Overflow[
^]
Updated for code samples
AjaxFunctions.php
This file has two parts:
_Part 1 sees if there is an action to perform and if so which to do
_Part 2 contains the various functions that can be called
<?php
if (isset($_POST['action'])) {
switch ($_POST['action']) {
case 'PDF':
DownloadPDF();
break;
case 'TXT':
DownloadTxt();
break;
}
}
function DownloadPDF() {
exit;
}
function insert() {
exit;
}
?>