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) "sfsfd@afaf.com"}
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) "sfsfd@afaf.com"}
$yourArray = array('FirstName' => 'abc', 'LastName' => 'cvbcb', 'Email' => 'sfsfd@afaf.com');
First of all you have the array like this:
$arr = array('FirstName' => 'abc',
'LastName' => 'cvbcb',
'Email' => 'sfsfd@afaf.com'
);
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']; // sfsfd@afaf.com