RE: splitting string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



M. Sokolewicz <mailto:tularis@xxxxxxx>
    on Tuesday, November 16, 2004 12:47 PM said:

>> Chris W. Parker wrote:
>> 
>>> Yes.
>>> 
>>> $string = "$string1|$string2|$string3|$string4|$string5";
>>> 
>>> 
>>> $string_back = explode("|", $string);
>>> 
> please explain...  WHY is that better?

Well it's better because it's a lot easier to read for one and two
because the pipe is a relatively safe delimiter. Kelly has a good idea
about using a tab (\t) instead, but if we want to get *really* crazy
let's use something like $#*$(#*@(*$@ as a delimiter. For sure that's
not going to be duplicated on accident. :)



Chris.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux