User Tools

Site Tools


uphp:functions:function_exists

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
uphp:functions:function_exists [2017/04/12 09:12]
jeff
uphp:functions:function_exists [2021/09/13 05:57] (current)
Line 7: Line 7:
 ====Description==== ====Description====
  
-<well size="sm"> +<well size="sm"><html>
-<html>+
 <span style="font-size:125%;color:green">int <span style="font-size:125%;color:green">int
-<span style="color:black"> +<span style="color:black">function_exists (
-</html> +
-[[function_exists]] ( +
-<html>+
 <span style="color:green">string <span style="color:green">string
 <span style="color:blue">$function_name <span style="color:blue">$function_name
 <span style="color:black">) <span style="color:black">)
-</html> +</html></well>
-</well>+
  
 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. 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.
Line 24: Line 19:
 ====Parameter==== ====Parameter====
  
-<html><b><span style="color:blue">$function_name<span style="color:black"></b></html>:  <html><b><span style="color:green">String<span style="color:black"></b></html> containing the name of the function to check for existence+<html><b><span style="color:blue">$function_name<span style="color:black"></b>:  <b><span style="color:green">String<span style="color:black"></b> containing the name of the function to check for existence</html>
  
-====Return Value====+====Return Values====
  
 <html><b><span style="color:green">Integer<span style="color:black"></b></html>:  1 (true) if the function exists, 0 (false) if the function does not exist <html><b><span style="color:green">Integer<span style="color:black"></b></html>:  1 (true) if the function exists, 0 (false) if the function does not exist
Line 32: Line 27:
 ====Examples==== ====Examples====
  
-**Check for the existence of the [[array_key()]] function (available if firmware >= 1.953):**+===Check for the existence of the 'array_keyfunction (available if firmware >= 1.953)===
  
 <code php> <code php>
Line 45: Line 40:
 </code> </code>
  
-**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>
uphp/functions/function_exists.1491988376.txt.gz · Last modified: 2021/09/13 05:56 (external edit)