Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Prodentim Probiotics Specially Designed For The Health Of Your Teeth And Gums

Instant Grammar Checker - Correct all grammar errors and enhance your writing

Teach Your Child To Read

Powerful WordPress hosting for WordPress professionals

Disclosure: My content contains affiliate links.

31,151 questions

40,705 answers

573 users

How to extract keys in the array into new variables with prefix in PHP

1 Answer

0 votes
$arr = array('name' => "Avi", 'age' => 48, 'profession' => "Programmer");
extract($arr, EXTR_PREFIX_ALL, "employee");
echo "$employee_name, $employee_age, $employee_profession <br>"; // Avi, 48, Programmer
echo "$employee_name <br>"; // Avi
echo "$employee_age <br>"; // 48
echo "$employee_profession <br>"; // Programmer




answered Jun 21, 2014 by avibootz
edited Jun 21, 2014 by avibootz
...