YouTip LogoYouTip

Php Var_Export Function

# PHP var_export() Function [![Image 3: PHP Available Functions](#)PHP Available Functions](#) The **var_export()** function outputs or returns a variable as a string representation. The **var_export()** function returns structural information about the variable passed to it. It is similar to [var_dump()](#), but the difference is that it returns a valid PHP code. PHP Version Requirement: PHP 4 >= 4.2.0, PHP 5, PHP 7 ### Syntax mixed var_export ( mixed $expression [, bool $return ] ) Parameter Description: * $expression: The variable you want to output. * $return: Optional. If set to TRUE, the function will not execute the output, but will return the output result to a variable. ### Return Value Returns a value only when $return is set to true, returning the structural information of the variable. ### Example ## Example The output will be: array ( 0 => 1, 1 => 2, 2 => array ( 0 => 'a', 1 => 'b', 2 => 'c', ),) Optional parameter $return set to true: ## Example The output will be: 3.1 [![Image 4: PHP Available Functions](#)PHP Available Functions](#)
← Jsref IsarrayPhp Unset Function β†’