Here is my array and i want to store to a variable , how to do this
array(4) {["FirstName"]=> string(3) "abc" ["LastName"]=> string(5) "cvbcb" ["Email"]=> string(14) "[email protected]"}
Here is my array and i want to store to a variable , how to do this
array(4) {["FirstName"]=> string(3) "abc" ["LastName"]=> string(5) "cvbcb" ["Email"]=> string(14) "[email protected]"}
$yourArray = array('FirstName' => 'abc', 'LastName' => 'cvbcb', 'Email' => '[email protected]');
First of all you have the array like this:
$arr = array('FirstName' => 'abc',
'LastName' => 'cvbcb',
'Email' => '[email protected]'
);
This is a single dimension array so you need to use the index / key
with the array name for access and assign each item from the array. Here is the demo.
$firstName = $arr['FirstName']; // abc
$LastName = $arr['LastName']; // cvbcb
$Email = $arr['Email']; // [email protected]