PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
a) write the function as Javascript, as that is client side
or
b) call the php page that holds the function, eg onClick="window.location('myscript.php');"
for the time being, PHP is server side, HTML is client side. They don't mix. i.e. HTML cannot call a php function as php has already finished processing the file once the HTML is output.