Friday, June 28, 2013

Include Array From File - PHP

file.php
<?php
return array('item1','item2');
?>

Your php code:

<?php
$thisVariable = include('file.php');
print_r($thisVariable); //prints the array
?>

No comments:

Post a Comment