Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

What are the uses of PHP functions (compact and extract ) ?

user-image
Question added by Adel Ezat Fawzy Ellozy , Webdeveloper. , Saudi Arabian Maritiem Sports Federation
Date Posted: 2017/03/11
Nabil Rageh
by Nabil Rageh , Technical Support Manager , DenTech for communication and Information Technology

-The compact() function creates an array from variables and their values

The extract() function imports variables into the local symbol table from an array

Ali Imran Ahmad
by Ali Imran Ahmad , Frontend Web Developer , SheenSol Technologies

compact create array from local variables while extract creates local variables from array.

Muhammad Muzafar Shah
by Muhammad Muzafar Shah , MIS Manager (Management Information Systems Manager) , USAID Citizen's Voice Project

compact: Create array containing variables and their values

And

extract:  Import variables into the current symbol table from an array

More Questions Like This