View Single Post
  #14 (permalink)  
Old 08-16-2007, 10:11 PM
raj raj is offline
D-Web Programmer
 
Join Date: Jul 2007
Posts: 89
raj is on a distinguished road
Post Info: Array Compact Function

hi all,

- Create array containing variables and their values.

- This function create a array & this array key from variables name & values from their values.

eg:

$city = "San Francisco";
$state = "CA";
$event = "SIGGRAPH";

$location_vars = array("city", "state");

$result = compact("event", $location_vars);


After this, $result will be:

Array
(
[event] => SIGGRAPH
[city] => San Francisco
[state] => CA
)
Reply With Quote