In PHP, how do I check if a function exists?
http://php.net/manual/en/function.function-exists.php
<?php
if (!function_exists('myfunction')) {
function myfunction()
{
//write function statements
}
}
?>
Using function_exists
:
if(function_exists('my_function')){
// my_function is defined
}