PHP get_defined_functions() function

In this chapter you will learn:

  1. What is PHP get_defined_functions() function
  2. Syntax for PHP get_defined_functions() function
  3. Return Values
  4. Example - Get all functions

Description

Returns an array of all defined functions.

Syntax

array get_defined_functions ( void )

Return Values

Returns a multidimensional array containing a list of all defined functions, both built-in (internal) and user-defined.

The internal functions will be accessible via $arr["internal"], and the user defined ones using $arr["user"].

Example

Get all functions


<?php/*from j a v a2s.  c  o m*/
function my(){
    return "java2s.com";
}

$arr = get_defined_functions();

print_r($arr);
?>

The code above generates the following result.

Next chapter...

What you will learn in the next chapter:

  1. What is PHP instanceof
  2. Syntax for PHP instanceof
  3. Example - How to use PHP instanceof
Home » PHP Tutorial » PHP Class Functions
PHP class_exists() function
PHP get_class() function
PHP get_declared_classes() function
PHP get_declared_interfaces() function
PHP get_defined_functions() function
PHP instanceof
PHP serialize() function