note 109163 added to function.session-start
| From: | Pierre | Date: | Mon, 25 Jun 2012 08:52:33 +0000 |
| Subject: | note 109163 added to function.session-start | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188784@lists.php.net to get a copy of this message | ||
@will dot joi at hotmail dot com
In your example, there is no difference between simple and double quote :
if($_SESSION['nome'] == "") is the same as ($_SESSION['nome'] ==
'')
You could use if(strlen($_SESSION['nome']))
But if you want to check session you must prefer : if(isset($_SESSION['nome'])) or the
better way if(!empty($_SESSION['nome']))
The first test can be empty, not the second one.
----
Server IP: 69.147.83.197
Probable Submitter: 90.24.204.11
----
Manual Page -- http://www.php.net/manual/en/function.session-start.php
Edit -- https://master.php.net/note/edit/109163
Del: integrated -- https://master.php.net/note/delete/109163/integrated
Del: useless -- https://master.php.net/note/delete/109163/useless
Del: bad code -- https://master.php.net/note/delete/109163/bad+code
Del: spam -- https://master.php.net/note/delete/109163/spam
Del: non-english -- https://master.php.net/note/delete/109163/non-english
Del: in docs -- https://master.php.net/note/delete/109163/in+docs
Del: other reasons-- https://master.php.net/note/delete/109163
Reject -- https://master.php.net/note/reject/109163
Search -- https://master.php.net/manage/user-notes.php