Anonymous user / 3.148.108.174 Log In Register
?
Wallet: 3.00
Daily Credits:
1.20 / 1.20

PHP Functions Online


var_export

(PHP 4 >= 4.2.0, PHP 5)

var_exportOutputs or returns a parsable string representation of a variable

mixed var_export(mixed $expression[, bool $return = false])

Checkout ? #

Item Description Item Price Your Price
Total

Preview #

${{ variable.param.name }} = {{ variable.param|getValue:variable.form:true }};
{{ call.result}} = ;

Description #

mixed var_export ( mixed $expression [, bool $return = false ] )

Parameters #

expression

The variable you want to export.

return

If used and set to TRUE, var_export() will return the variable representation instead of outputting it.

Return Values #

Returns the variable representation when the return parameter is used and evaluates to TRUE. Otherwise, this function will return NULL.

Examples #

Example #1 var_export() Examples

<?php
$a 
= array (12, array ("a""b""c"));
var_export($a);
?>

The above example will output:

array (
  0 => 1,
  1 => 2,
  2 => 
  array (
    0 => 'a',
    1 => 'b',
    2 => 'c',
  ),
)
<?php

$b 
3.1;
$v var_export($btrue);
echo 
$v;

?>

The above example will output:

3.1

Changelog #

Version Description
5.1.0 Possibility to export classes and arrays containing classes using the __set_state() magic method.

Notes #

Note:

When the return parameter is used, this function uses internal output buffering so it cannot be used inside an ob_start() callback function.

See Also #