This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
uphp:functions:function_exists [2017/04/06 14:55] jeff created |
uphp:functions:function_exists [2017/05/08 14:26] jeff |
||
---|---|---|---|
Line 10: | Line 10: | ||
< | < | ||
<span style=" | <span style=" | ||
- | <span style=" | + | <span style=" |
- | </ | + | |
- | [[function_exists]] ( | + | |
- | < | + | |
<span style=" | <span style=" | ||
<span style=" | <span style=" | ||
Line 20: | Line 17: | ||
</ | </ | ||
- | 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 Value==== | ====Return Value==== | ||
- | 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 42: | ||
</ | </ | ||
- | **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> |