note 116406 deleted from function.trim by salathe
| From: | salathe@php.net | Date: | Fri, 02 Jan 2015 11:30:10 +0000 |
| Subject: | note 116406 deleted from function.trim by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-201327@lists.php.net to get a copy of this message | ||
Note Submitter: enriqe
----
If you want to get rid of those "UTF-8 starting bytes" which are saved at the beginning of
the file saved in UTF-8 (if saved with ByteOrderMask), use this:
<?php
trim( file_get_contents($filePath), "\xEF\xBB\xBF");
?>
or add them to default characters :
<?php
trim( file_get_contents($filePath), " \t\n\r\0\x0B\xEF\xBB\xBF");
?>