Calling a php function using onclick event

The onclick event of html tag works for javascript but not for php code. But you can call a php function by onclick event within javascript code using Javascript document.write() function. In this way you can easily access a php function by onclick event of html tag within javascript code.Let see below

<?php
          function phpcluster(){
              echo "Hello Vikash";
          }
    ?>
<input type="button" name="check" onclick="document.write('<?php  phpcluster () ?>');" value="Check">