0

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

How to store

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

into variables the key and value

1
  • 3
    extract() does exactly that, but consider if you really want to. Leaving them as array keys often makes for much more organized code assuming these values are related... Commented Apr 1, 2014 at 20:37

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.