将数组转换为两个不同的字符串php [关闭]

I have an array with following elements:

$arr = array(
    'nick' => "blabla",
    'pass => "blabla2"'
);

I would like to convert it somehow to strings, the first string would be the value of nick - "blabla", the second string would be the value of pass - "blabla2"

Thank you.

If you want to convert elements of the array to separate string variables you can use extract function to import elements from an array to variables. For example:

$arr =  array(
   'nick' => "blabla",
   'pass' => "blabla2"
);

extract($arr);

echo $nick, ' ', $pass;
$arr =  [
   'nick' => "blabla",
   'pass' => "blabla2"
];

$string_one=$arr['nick'];
$string_two=$arr['pass'];