在PHP中,如何检查函数是否存在? [英] In PHP, how do I check if a function exists?
本文介绍了在PHP中,如何检查函数是否存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何检查函数 my_function
是否已经存在于PHP中?
使用 function_exists
:
if(function_exists('my_function')){
// my_function is defined
}
How can I check if the function my_function
already exists in PHP?
解决方案
Using function_exists
:
if(function_exists('my_function')){
// my_function is defined
}
这篇关于在PHP中,如何检查函数是否存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文