|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-09-02 22:52 UTC] sniper@php.net
[2000-10-02 23:16 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 12 11:00:01 2026 UTC |
I have a script that reads tab separated values from a file. It seems that if the file contains multiple tabs without data in between, explode and split return the second tab as the first character of the next string. E.g: $str = "text\tsome more\t\teven more"; $vals = explode("\t", $str); and you get $vals = array("text", "some more", "\teven more"); I would, of course, expect to get $vals = array("text", "some more", "", "even more"); This is very annoying, I need to first replace every "\t\t" with something like "\t \t" and then check if some of the values is " " and convert it into "". The same behaviour is found in split().