PHP | ReflectionExtension export() Function Last Updated : 13 Dec, 2019 Comments Improve Suggest changes Like Article Like Report The ReflectionExtension::export() function is an inbuilt function in PHP which is used to return the export as a string if the return parameter is set to TRUE, otherwise NULL is returned. Syntax: string ReflectionExtension::export( string $name, string $return ) Parameters: This function accepts two parameters as mentioned above and described below: $name: This parameter holds the export of reflection. $return: This parameter holds the Boolean value. If its value is set to True then it will export the reflected extension. If its value is set to False then it will not export the reflected extension. Return Value: This function returns the export as a string if the return parameter is set to TRUE, otherwise NULL is returned. Below programs illustrate the ReflectionExtension::export() function in PHP: Program_1: php <?php // Defining an extension $A = 'DOM'; // Using ReflectionExtension() over the // specified extension $extension = new ReflectionExtension($A); // Calling the export() function $B = $extension->export($A, $return = FALSE); // Getting the export as a string var_dump($B); ?> Output: Extension [ <persistent> extension #18 dom version 20031129 ] { - Dependencies { Dependency [ libxml (Required) ] Dependency [ domxml (Conflicts) ] } - Constants [45] { Constant [ integer XML_ELEMENT_NODE ] { 1 } . . . Constant [ integer DOM_VALIDATION_ERR ] { 16 } } . . . . . . - Parameters [3] { Parameter #0 [ <required> $expr ] Parameter #1 [ <optional> DOMNode or NULL $context ] Parameter #2 [ <optional> $registerNodeNS ] } } Method [ <internal:dom> public method registerPhpFunctions ] { - Parameters [0] { } } } } } } NULL Program_2: php <?php // Using ReflectionExtension() over // a extension xml $extension = new ReflectionExtension('xml'); // Calling the export() function and // Getting the export as a string var_dump($extension->export('xml', $return = TRUE)); ?> Output: string(6209) "Extension [ <persistent> extension #15 xml version 7.0.33-0ubuntu0.16.04.7 ] { - Dependencies { Dependency [ libxml (Required) ] } . . . Function [ <internal:xml> function utf8_decode ] { - Parameters [1] { Parameter #0 [ <required> $data ] } } } } " Reference: https://www.php.net/manual/en/reflectionextension.export.php Create Quiz Comment K Kanchan_Ray Follow 0 Improve K Kanchan_Ray Follow 0 Improve Article Tags : Web Technologies PHP PHP-function PHP- Reflection Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like