You are here: Re: Problem When Serializing Array With Multiline Text « PHP Programming Language « IT news, forums, messages
Re: Problem When Serializing Array With Multiline Text

Posted by Bocah Sableng on 04/30/07 04:28

On Apr 30, 6:20 am, dawnerd <dawn...@gmail.com> wrote:
> Hello everyone.
>
> I have a question, or problem if you will, that I'm sure someone knows
> the answer to. I have a database that stores information on a given
> user. The information is stored in a serialized array. This works
> flawlessly when using only single line text. When I tried to store
> multiline text, the problem arose.
>
> When the serialized data is deserialized, the array breaks. Any
> suggestions?

I test (on windows using CLI):

$a[] = "username";
$a[] = 15;
$a[] = "Not Found Street\n12345\nNowhere City";
$a[] = "Not Found Street\r\n12345\r\nNowhere City";
$k = serialize($a);
$u = unserialize($k);
var_dump($a);
var_dump($k);
var_dump($u);

Seems fine for me.

Please show us:
1. The content of the serialized variable before it stored to
database?
2. The content of the deserialized variable picked from database?
3. Field type you use to store serialized data?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация