note 85683 added to language.operators.logical

From: Date: Fri, 12 Sep 2008 03:07:52 +0000
Subject: note 85683 added to language.operators.logical
Groups: php.notes 
Request: Send a blank email to php-notes+get-144352@lists.php.net to get a copy of this message
There's one userful way to use the or operator: <?php //If the connection was success, "Connected to database" will be shown. //If the connection was failed, "Unable to connect" will be shown.(NOTE: The @ will hide error messages) @mysql_connect("localhost", "root", "password") or die("Unable to connect"); echo "Connected to database"; ?> So you don't need to use if operators to add more lines. ---- Server IP: 216.235.15.211 Probable Submitter: 70.71.75.169 ---- Manual Page -- http://www.php.net/manual/en/language.operators.logical.php Edit -- https://master.php.net/note/edit/85683 Del: integrated -- https://master.php.net/note/delete/85683/integrated Del: useless -- https://master.php.net/note/delete/85683/useless Del: bad code -- https://master.php.net/note/delete/85683/bad+code Del: spam -- https://master.php.net/note/delete/85683/spam Del: non-english -- https://master.php.net/note/delete/85683/non-english Del: in docs -- https://master.php.net/note/delete/85683/in+docs Del: other reasons-- https://master.php.net/note/delete/85683 Reject -- https://master.php.net/note/reject/85683 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#144352) next »