<?php
$city = "San Francisco";
$state = "CA";
$event = "SIGGRAPH";
$location_vars = array("city", "state");
$result = compact("event", "nothing_here", $location_vars);
print_r($result);
?>
The above example will output:
Array
(
[event] => SIGGRAPH
[city] => San Francisco
[state] => CA
)