note 104821 added to control-structures.switch

From: Date: Sat, 09 Jul 2011 04:27:04 +0000
Subject: note 104821 added to control-structures.switch
Groups: php.notes 
Request: Send a blank email to php-notes+get-181370@lists.php.net to get a copy of this message
Quotable Cases [code] 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; [/code] ---- Server IP: 69.147.83.197 Probable Submitter: 50.104.59.39 ---- Manual Page -- http://www.php.net/manual/en/control-structures.switch.php Edit -- https://master.php.net/note/edit/104821 Del: integrated -- https://master.php.net/note/delete/104821/integrated Del: useless -- https://master.php.net/note/delete/104821/useless Del: bad code -- https://master.php.net/note/delete/104821/bad+code Del: spam -- https://master.php.net/note/delete/104821/spam Del: non-english -- https://master.php.net/note/delete/104821/non-english Del: in docs -- https://master.php.net/note/delete/104821/in+docs Del: other reasons-- https://master.php.net/note/delete/104821 Reject -- https://master.php.net/note/reject/104821 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#181370) next »