This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uphp:functions:function_exists [2017/04/06 14:55] jeff created |
uphp:functions:function_exists [2021/09/13 05:57] (current) |
||
---|---|---|---|
Line 7: | Line 7: | ||
====Description==== | ====Description==== | ||
- | <well size=" | + | <well size=" |
- | < | + | |
<span style=" | <span style=" | ||
- | <span style=" | + | <span style=" |
- | </ | + | |
- | [[function_exists]] ( | + | |
- | < | + | |
<span style=" | <span style=" | ||
<span style=" | <span style=" | ||
<span style=" | <span style=" | ||
- | </ | + | </ |
- | </ | + | |
- | This function will check to see if a function exists in firmware (native) or has been defined in the current script context (custom). | + | This function will check to see if a function exists in firmware (native, internal) or has been defined in the current script context (custom, user-defined). It is useful if a script needs to determine if it is being run on an older version of the firmware that might not have some of the newer functions. It can also be used for controlling flow in scripts that define custom functions depending on certain conditions or [[include|included]] files. |
====Parameter==== | ====Parameter==== | ||
- | < | + | < |
- | ====Return | + | ====Return |
- | Return | + | < |
====Examples==== | ====Examples==== | ||
- | **Check for the existence of the [[array_key()]] function (available if firmware >= 1.953):** | + | ===Check for the existence of the 'array_key' |
<code php> | <code php> | ||
Line 45: | Line 40: | ||
</ | </ | ||
- | **Load a list of custom functions and check that a function is included before calling it:** | + | ===Load a list of custom functions and check that a function is included before calling it=== |
<code php> | <code php> |