User Tools

Site Tools


uphp:functions:function_exists

This is an old revision of the document!


function_exists

WMPRO, WMMINI FW >= 1.887 WMMEGA FW >= 2.0

Checks if a function (custom or native) exists and returns 1 if so

Description

int function_exists ( string $function_name ... ] )

Parameters

$function_name: String containing the name of the user function to call

$parameters: Optional parameter(s) to pass to the function

Return Value

Any type depending on the way the function is defined

Example

<?
  function my_add($x,$y) {
    return $x+$y;
  }
  $result=call_user_func("my_add",1,3);
  print($result); // result is 4
?>

See Also

function - Define a function

return - Return program control to the calling module

Additional Information

User defined functions can take many different forms, and it is not necessary to use call_user_func() to execute a function unless a direct return value is needed.

If used within a function, the return statement immediately ends execution of the function, and returns its argument as the value of the function call.

uphp/functions/function_exists.1491480291.txt.gz · Last modified: 2021/09/13 05:56 (external edit)