- var_dump: documentation ( source)
<?php
$contact_rec = [
"bob" => ["email" => "bob@example.com"],
"sara" => ["email" => "sara@example.com"]
];
$contact_rec[0]="";
//The emails of the client
foreach($contact as $key => $value)
{
if($value['email'] != null)
$contact_rec[] = $value['email'];
}
foreach($contact_rec as $key => $value)
{
$contact_rec[$value] = $value;
unset($contact_rec[$key]);
}
var_dump($contact_rec)
?>