note 21917 deleted from function.chop by spic
| From: | spic@php.net | Date: | Mon, 26 Aug 2002 19:05:10 +0000 |
| Subject: | note 21917 deleted from function.chop by spic | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-35678@lists.php.net to get a copy of this message | ||
Correction...the above example is similar to chop, not chomp. Below is an example of chomp.
$mystr1 = "This is my string\n";
// Similar to chomp. Removes newline at end of string
// if and only if newline character is at the end.
$mystr1 = preg_replace("/\n$/", "", $mystr1);