Can i define an associative array using name and value of some variables at the same time and without looping in a simple elegant way?
I know it is possible taking variable names or setting it manually is not hard at all, but i think there might be a function to do this all at once. Or there should be one, but i didnt found any
Im looking a function similar to:
$ar_var= to_associative_array($name, $id, $start_date, $end_date, $status, $details);
... and being able to print something like:
echo $ar_var['status'];
echo $ar_var[5];//Usually you would use this to access this data
... or a vardump showing something like
name => 'John Doe'
id => 'FX1678798Z'
start_date = > '27/03/2018'
status => 'delivered'