Last active
August 29, 2015 13:57
-
-
Save gowon/9786803 to your computer and use it in GitHub Desktop.
Storing data into variable on include/require
This file contains 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 | |
//include.php | |
function add($x, $y) { | |
return $x + $y; | |
} | |
return add(5,10); | |
?> | |
<?php | |
//index.php | |
$added = include 'include.php'; | |
echo $added; | |
//Output: 15 | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment