|
Posted by Kimmo Laine on 08/29/05 15:57
"Frank Bemelman" <f.bemelmanq@xs4all.invalid.nl> wrote in message
news:4312ffba$0$11178$e4fe514c@dreader20.news.xs4all.nl...
> Dear group,
>
> I'm trying to explode a tab delimited string into
> an array of strings, using explode.
>
> It seems that when I explode "\t\t\tone\ttwo\tthree\tfour"
> it gives me 4 strings: "one", "two", "three", "four".
>
> I expected to get 6 strings: "","","one", "two", "three", "four".
>
> Is this normal behaviour, or is there another method
> to get what I want?
I got exactly what you expected to get. Using PHP5 on IIS6/Win2003.
$kaboom = explode ("\t", "\t\t\tone\ttwo\tthree\tfour");
var_dump($kaboom);
prints
array(7) {
[0]=>
string(0) ""
[1]=>
string(0) ""
[2]=>
string(0) ""
[3]=>
string(3) "one"
[4]=>
string(3) "two"
[5]=>
string(5) "three"
[6]=>
string(4) "four"
}
--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com
Navigation:
[Reply to this message]
|