note 112798 added to function.is-string
| From: | SammyMoshe | Date: | Tue, 23 Jul 2013 23:43:56 +0000 |
| Subject: | note 112798 added to function.is-string | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-195742@lists.php.net to get a copy of this message | ||
The cool thing about this function is that it lets you be a lot more specific with your logic than
you could have been before. And since I'm all about explicit control, when it comes to code,
this one gets me all hot and bothered.
<?php
//Like this. You could also do the reverse of it.
if(is_string($variable) ) && !is_array($variable) ){
//Do something that appeals to your controlling nature.
}
?>
God bless those php dev guys for thinking of everything.
----
Server IP: 69.147.83.199
Probable Submitter: 107.220.9.41
----
Manual Page -- http://php.net/manual/en/function.is-string.php
Edit -- https://master.php.net/note/edit/112798
Del: integrated -- https://master.php.net/note/delete/112798/integrated
Del: useless -- https://master.php.net/note/delete/112798/useless
Del: bad code -- https://master.php.net/note/delete/112798/bad+code
Del: spam -- https://master.php.net/note/delete/112798/spam
Del: non-english -- https://master.php.net/note/delete/112798/non-english
Del: in docs -- https://master.php.net/note/delete/112798/in+docs
Del: other reasons-- https://master.php.net/note/delete/112798
Reject -- https://master.php.net/note/reject/112798
Search -- https://master.php.net/manage/user-notes.php