Php uses function_exists to check whether the function exists. phpfunction_exists. Php uses function_exists to check whether a function exists. phpfunction_exists describes how php uses function_exists to check whether a function exists. I would like to share with you how php uses function_exists to check whether a function exists. phpfunction_exists
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.
Examples in this article describes how php uses function_exists to check whether a function exists. Share it with you...