PHP: Import variables into the current symbol table from an array
$params = array("x1" => "VALUE OF X1");
extract($params);
echo (isset($x1) ? "X1=".$x1 : "NO X1 DEFINED") . "<BR>";
echo (isset($x2) ? "X2=".$x2 : "NO X2 DEFINED") . "<BR>";
And output would be following:
X1=VALUE OF X1
NO X2 DEFINED
$params = array("x1" => "VALUE OF X1");
extract($params);
echo (isset($x1) ? "X1=".$x1 : "NO X1 DEFINED") . "<BR>";
echo (isset($x2) ? "X2=".$x2 : "NO X2 DEFINED") . "<BR>";
And output would be following:
X1=VALUE OF X1
NO X2 DEFINED