note 21942 added to split
| From: | jchart at sdccu dot net | Date: | Fri, 31 May 2002 16:56:20 +0000 |
| Subject: | note 21942 added to split | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31299@lists.php.net to get a copy of this message | ||
The reason your code:
$line = "12|3|Fred";
list ($msgid, $msgref, $msgtopic)=split('|', $line);
didn't work is because the "|" symbol is an operator in PHP. If you want to use the
pipe symbol as a delimiter you must excape it with a back slash, "\|". You code should
look like this:
$line = "12|3|Fred";
list ($msgid, $msgref, $msgtopic)=split('\|', $line);
--
http://www.php.net/manual/en/split.php
http://master.php.net/manage/user-notes.php?action=edit+21942
http://master.php.net/manage/user-notes.php?action=delete+21942
http://master.php.net/manage/user-notes.php?action=reject+21942