note 56751 added to function.isset

From: Date: Wed, 14 Sep 2005 10:41:52 +0000
Subject: note 56751 added to function.isset
Groups: php.notes 
Request: Send a blank email to php-notes+get-95158@lists.php.net to get a copy of this message
I don't know if you guys can use this but i find this piece of code pretty useful (for readabillity at least): function isset_else( $&v, $r ) { if( isset( $v )) return $v; else return $r; } This way you can go: $a = 4; $c += isset_else( $a, 0 ); $c += isset_else( $b, 0 ); echo $c; Of course, this code would work anyway, but you get the point. ---- Manual Page -- http://www.php.net/manual/en/function.isset.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56751 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56751&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56751&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56751&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56751&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56751&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56751&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56751&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95158) next »