This article mainly introduces how to use function_exists to check whether a function exists in php. The example shows how to use function_exists to check whether a function exists and call related techniques in php. It is very useful and requires
This article mainly introduces how to use function_exists to check whether a function exists in php. The example shows how to use function_exists to check whether a function exists and call related techniques in php. It is very useful and requires
This example describes how to use function_exists to check whether a function exists in php. Share it with you for your reference. The specific analysis is as follows:
In php, you can use the function_exists () function to check whether another function exists. You can pass the function name as a string to function_exists to check whether the function exists.
Function highlight ($ txt) {return "$ txt";} function textWrap ($ tag, $ txt, $ func = "") {if (function_exists ($ func )) $ txt = $ func ($ txt); return "<$ tag> $ txt \ N ";}
Example:
Echo textWrap ('I', 'function exists demo', 'highlight'); // function exists Demo in italics
I hope this article will help you with php programming.
,