如何检查PHP中是否已经存在该函数?my_function
my_function
使用function_exists:
function_exists
if(function_exists('my_function')){ // my_function is defined }
http://php.net/manual/en/function.function-exists.php
<?php if (!function_exists('myfunction')) { function myfunction() { //write function statements } } ?>