PHP code example of nazonohito51 / var-utils

1. Go to this page and download the library: Download nazonohito51/var-utils library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nazonohito51 / var-utils example snippets


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

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

// compatible: compact("event", "nothing_here", $location_vars);
$result = Vars::compact(get_defined_vars(), "event", "nothing_here", $location_vars);
print_r($result);

/*
Array
(
    [event] => SIGGRAPH
    [city] => San Francisco
    [state] => CA
)
*/