php check if function code example
Example 1: function exists
function_exists('function_name'); //Will return true if function exists
Example 2: check if a function is callable php
<?php
function test1(){
}
var_dump( is_callable("test1") );
var_dump( is_callable("test2") );
?>
// Output -
// bool(true) bool(false)