Re: splitting string
| From: | Dennis Lahay | Date: | Tue, 16 Nov 2004 19:15:25 +0000 |
| Subject: | Re: splitting string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-202201@lists.php.net to get a copy of this message | ||
I usually put a bar "|" between each string, if I need to.
$string = $string1."|".$string2."|".$string3."|".$string4."|".$string5;
D
On Nov 16, 2004, at 12:01 PM, Afan Pasalic wrote:
I create a string from other strings: $string = $string1."\n".$string2."\n".$string3."\n".$string4."\n".$string5; and then store it in DB. But, I can't figure out how to split them back? Tried: $string_back = explode('\n', $string); $string_back = explode('<br>', $string); $string_back = explode('<br />', $string); Anu help? 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?) Thanks for any help! -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php