Piya
Piya

Reputation: 1144

Save array values into variables PHP

I have an array Array ( [email] => [email protected] [mobileNo] => 9999999999 )

How to store

$email = '[email protected]'
$mobileNo = '9999999999'

into variables the key and value

Upvotes: 0

Views: 47

Answers (1)

hsz
hsz

Reputation: 152206

Just try with extract

$input = array('email' => '[email protected]', 'mobileNo' => 9999999999);
extract($input);

var_dump($email, $mobileNo);

Output:

string '[email protected]' (length=12)
int 9999999999

Upvotes: 1

Related Questions