<?php $name = 'John doe'; $age = 42; $location = 'Singapore'; print_r(compact('name', 'age', 'location'));
Output:
Array ( [name] => John doe [age] => 42 [location] => Singapore )