note 116497 deleted from function.return by peehaa
| From: | peehaa@php.net | Date: | Sun, 28 Apr 2019 10:28:16 +0000 |
| Subject: | note 116497 deleted from function.return by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210787@lists.php.net to get a copy of this message | ||
Note Submitter: Anonim
----
Also note, what you cannot do anything after the 'return' usage in function.
For example:
<?php
$_SESSION['text'] = 'Best PHP';
function getText()
{
$text = $_SESSION['text'];
return $text;
unset($_SESSION['text']);
}
echo getText().'<br />';
echo $_SESSION['text'];
?>
This will output:
Best PHP
Best PHP
Twice, because we have used unset() function after 'return'.