PHP - Array Functions
What will be the output of this PHP code?
$data = ['name' => 'John', 'age' => 25];
extract($data);
echo "$name is $age years old.";
$data = ['name' => 'John', 'age' => 25];
extract($data);
echo "$name is $age years old.";
$name and $age from the array keys with their values.$name is 'John' and $age is 25, so the echo prints "John is 25 years old."15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions