note 104821 deleted from control-structures.switch by derick
| From: | derick@php.net | 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.='<';
break;
case '>' : $response.='>';
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;
?>