note 28369 added to function.split
| From: | jeffrey at jhu dot edu | Date: | Fri, 10 Jan 2003 19:51:43 +0000 |
| Subject: | note 28369 added to function.split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41971@lists.php.net to get a copy of this message | ||
In answer to gwyne at gmx dot net, dec 1, 2002:
For split(), when using a backslash as the delimiter, you have to *double escape* the backslash.
example:
==================================
<pre>
<?
$line = 'stuff\\\thing\doodad\\';
$linearray = split('\\\\', $line); //<--NOTE USE OF FOUR(4)backslashes
print join(":", $linearray);
?>
</pre>
==================================
output is:
<pre>
stuff::thing:doodad:
</pre>
--
http://www.php.net/manual/en/function.split.php
http://master.php.net/manage/user-notes.php?action=edit+28369
http://master.php.net/manage/user-notes.php?action=delete+28369
http://master.php.net/manage/user-notes.php?action=reject+28369