<?php
mixed var_export ( mix $expr [, bool $return = FALSE ] )
where,
$expr = VARIABLE to be exported
$return = To control the display, or not of the variable
( SEE the below TABLE )
?>
VALUE | CONTROL |
FALSE | The information will be displayd |
TRUE | The information will not be displayed, however, considered |
ed48 |
<?php
$ex01 = 'THIS IS A SIMPLE STRING EXAMPLE';
var_export($ex01);
echo '<br><br>';
$ex02 = 1234567;
var_export($ex02);
$ex03 = 1E19;
$ex04 = 1.6e-19;
echo '<br><br>';
var_export($ex03);
echo '<br><br>';
var_export($ex04);
echo '<br><br>';
$ex05 = NULL;
var_export($ex05);
echo '<br><br>';
$ex06 = TRUE;
$ex07 = true;
$ex08 = FALSE;
$ex09 = false;
var_export($ex06);
echo '<br><br>';
var_export($ex09);
echo '<br><br>';
// INTERNAL
$ex10 = $_SERVER;
var_export($ex10);
echo '<br><br>';
$ex11 = ["Countries", "Continents",
["Brasil", "Portugal", "Japan"],
["South America", "Europe", "Asia"] ];
var_export($ex11);
?>
<?php
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This encoding does not display anything at all
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$exp01 = 'THIS IS A SIMPLE STRING EXAMPLE';
var_export($exp01, TRUE);
echo '<br><br>';
$exp02 = 1234567;
var_export($exp02, TRUE);
$exp03 = 1E19;
$exp04 = 1.6e-19;
echo '<br><br>';
var_export($exp03, TRUE);
echo '<br><br>';
var_export($exp04, TRUE);
echo '<br><br>';
$exp05 = NULL;
var_export($exp05, TRUE);
echo '<br><br>';
$exp06 = TRUE;
$exp07 = true;
$exp08 = FALSE;
$exp09 = false;
var_export($exp06, TRUE);
echo '<br><br>';
var_export($exp09, TRUE);
echo '<br><br>';
// INTERNAL
$exp10 = $_SERVER;
var_export($exp10, TRUE);
echo '<br><br>';
$exp11 = ["Countries", "Continents",
["Brasil", "Portugal", "Japan"],
["South America", "Europe", "Asia"] ];
var_export($exp11, TRUE);
?>
<?php
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Nothing should be printed, however,
this exercise proves that values are considered
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
$expr01 = 'THIS IS A SIMPLE STRING EXAMPLE';
$v1 = var_export($expr01, TRUE);
echo $v1 . '<br><br>';
$expr02 = 1234567;
$v2 = var_export($expr02, true);
echo $v2 . '<br><br>';
$expr03 = 1E19;
$v3 = var_export($expr03, true);
echo $v3 . '<br><br>';
$expr04 = 1.6e-19;
$v4 = var_export($expr04, true);
echo $v4 . '<br><br>';
$expr05 = NULL;
$v5 = var_export($expr05, true);
echo $v5 . '<br><br>';
$expr06 = TRUE;
$v6 = var_export($expr06, true);
echo $v6 . '<br><br>';
$expr07 = true;
$expr08 = FALSE;
$expr09 = false;
$v9 = var_export($expr09, true);
echo $v9 . '<br><br>';
// INTERNAL
$expr10 = $_SERVER;
$v10 = var_export($expr10, TRUE);
echo $v10 . '<br><br>';
?>
<?php
$expr11 = ["Countries", "Continents",
["Brasil", "Portugal", "Japan"],
["South America", "Europe", "Asia"] ];
$v11 = var_export($expr11, TRUE);
echo '<pre>';
print($v11);
echo '</pre><br>';
?>
<?php
$expr05 = imagecreatetruecolor(10, 10);
var_dump($expr05);
echo '<br><br>';
var_export($expr05);
// Replaced gd resources with objects in PHP 8.0.x
?>