Skip to content

Instantly share code, notes, and snippets.

@gowon
Last active August 29, 2015 13:57
Show Gist options
  • Save gowon/9786803 to your computer and use it in GitHub Desktop.
Save gowon/9786803 to your computer and use it in GitHub Desktop.
Storing data into variable on include/require
<?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