Hey anyone could you explain the extract(); using associative array ? I'd appreciate your effort greatly . | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Hey anyone could you explain the extract(); using associative array ? I'd appreciate your effort greatly .

About extract in use

1st Aug 2016, 7:01 AM
Sajen "The Empathy"
Sajen "The Empathy" - avatar
3 Answers
0
extract is used to convert an array key to name of variable and the value associate of the key to value of the variable
4th Aug 2016, 9:09 AM
francis
0
Thanks dude Can you explain this using an example .
4th Aug 2016, 1:48 PM
Sajen "The Empathy"
Sajen "The Empathy" - avatar
0
if you create an array like $array = array (['day'] => "monday", ['month'] => "april", ['year'] => "2016"); and do extract of this array extract($array); you have now $day, $month, $year and you can use it like echo ($day . " " . $month ." ". $year); print : monday april 2016
5th Aug 2016, 1:29 PM
francis