Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- can leave out ?> to execute and print at terminal.
- */
- function countdown()
- {
- echo "4, 3, 2, 1, ";
- return "blastoff!"; //return should always be the last line in the function
- }
- $return_value = countdown(); //assign function to a variable, which also invokes the function to print echo line
- echo $return_value; //then this prints the return stm
- // Empty function that returns NULL
- function createVacuum(){
- return NULL; //can also leave this line out, especially the return keyword
- }
- echo createVacuum() * 10; // value printed as 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement