Created
July 21, 2019 03:23
-
-
Save mikeschinkel/ddac02c97ab95f626c8aff5804145a45 to your computer and use it in GitHub Desktop.
Example PHP showing how to "return" a value from a 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 | |
$version = require(__DIR__.'/version.php'); | |
echo "The current version is {$version}"; |
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 | |
// Returns version# "1.2.3" to requre()r | |
return "1.2.3"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment