note 97177 modified in function.unpack by danbrown
| From: | danbrown@php.net | Date: | Tue, 06 Apr 2010 21:34:26 +0000 |
| Subject: | note 97177 modified in function.unpack by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-167742@lists.php.net to get a copy of this message | ||
Reading a text cell from an Excel spreadsheet returned a string with low-order embedded nulls:
0x4100 0x4200 etc. To remove the nulls, used
<?php
$strWithoutNulls = implode( '', explode( "\0", $strWithNulls ) );
?>
(unpack() didn't seem to help much here; needed chars back to re-constitute the string, not
integers.)
--was--
Reading a text cell from an Excel spreadsheet returned a string with low-order embedded nulls:
0x4100 0x4200 etc. To remove the nulls, used
$strWithoutNulls = implode( '', explode( "\0", $strWithNulls ) );
(unpack() didn't seem to help much here; needed chars back to re-constitute the string, not
integers.)
http://php.net/manual/en/function.unpack.php