Created
July 22, 2013 15:46
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$list = array(); | |
$list[] = 'a'; | |
$list[] = 'b'; | |
$list[] = 'c'; | |
$list[] = 'd'; | |
return $list; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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