Using the list() function. : list « Utility Function « PHP






Using the list() function.

 
<?php 
$net_address = array("192.168.1.101", "255.255.255.0", "192.168.1.1"); 
list($ip_addr, $net_mask, $gateway) = $net_address; 
echo "ip addr = $ip_addr\n"; 
echo "net mask = $net_mask\n"; 
echo "gateway = $gateway\n"; 
?>
  
  








Related examples in the same category

1.list($maths, $english, , $biology) = $scores;
2.Each line is converted into an array
3.Extracting Values from an Array Using list()