Skip to content

Instantly share code, notes, and snippets.

@catalint
Created July 22, 2013 15:46
Show Gist options
  • Save catalint/6054924 to your computer and use it in GitHub Desktop.
Save catalint/6054924 to your computer and use it in GitHub Desktop.
You can assign to any var the returned variable from the included file
<?php
$list = array();
$list[] = 'a';
$list[] = 'b';
$list[] = 'c';
$list[] = 'd';
return $list;
<?php
$fooBar = include('dummy_list.php');
print_r($fooBar);
/*
* OUTPUTS:
*
Array
(
[0] => a
[1] => b
[2] => c
[3] => d
)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment