note 104821 deleted from control-structures.switch by derick

From: Date: Mon, 03 Oct 2011 16:51:29 +0000
Subject: note 104821 deleted from control-structures.switch by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-183613@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- Quotable Cases <?php while (false !== ($char = fgetc($fp))) { switch ($char) { case '<' : $response.='&lt;'; break; case '>' : $response.='&gt;'; break; //case "\r" : // NOTE that the \r and \n WILL // match when enclosed within // double quotes, but WILL NOT // MATCH when enclosed within // single quotes. The < and > will // match when enclosed within // single quotes. case "\n" : $response.='<br />'; break; default : $response.=$char; } // switch } // while echo $response; ?>

« previous php.notes (#183613) next »