RE: splitting string

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

 



Afan Pasalic <mailto:afan@xxxxxxxx>
    on Tuesday, November 16, 2004 10:01 AM said:

> I  create a string from other strings:
> $string =
> $string1."\n".$string2."\n".$string3."\n".$string4."\n".$string5; and
> then store it in DB. 

[snip]

> Also, is there actially better way to do this then adding \n between
> strings?
> (e.g. store form fields name, address, city, state, zip, phone, email
> as a one string in db and later pull them from DB and split them
> back?)

Yes.

$string = "$string1|$string2|$string3|$string4|$string5";


$string_back = explode("|", $string);

-- 
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