<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP: unserialize() Error at offset&#8230; (simple solution)</title>
	<atom:link href="http://ryanbosinger.com/blog/2009/php-unserialize-error-at-offset-simple-solution/feed/" rel="self" type="application/rss+xml" />
	<link>http://ryanbosinger.com/blog/2009/php-unserialize-error-at-offset-simple-solution/</link>
	<description>things I learn, as I learn them</description>
	<lastBuildDate>Fri, 03 Sep 2010 22:00:08 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Melli</title>
		<link>http://ryanbosinger.com/blog/2009/php-unserialize-error-at-offset-simple-solution/comment-page-1/#comment-9436</link>
		<dc:creator>Melli</dc:creator>
		<pubDate>Mon, 17 May 2010 09:06:30 +0000</pubDate>
		<guid isPermaLink="false">http://ryanbosinger.com/blog/?p=95#comment-9436</guid>
		<description>I just want to say Thanks,
The trim() solution did not work in my case, but your advice put me on the path to what I believe is at the heart of this problem- database field lenght. As it turns out, serialize() will include a few control characters with the data. If the field lenght is too small, those control characters will be truncated with no error from the system that they were not included with your data. As it is, the bug dont show up until you are trying to retrieve the data with the &quot;unserialize()&quot; function. Of course, with some of the control characters missing, the retrieval fails. This  also explains, why trim() will work in some cases, depending on how much white space is can be removed with the trim(). For a permanent fix, increase the feild lenght in the database by a few characters to include the serialize control characters especially so if the data to be stored will vary in size.</description>
		<content:encoded><![CDATA[<p>I just want to say Thanks,<br />
The trim() solution did not work in my case, but your advice put me on the path to what I believe is at the heart of this problem- database field lenght. As it turns out, serialize() will include a few control characters with the data. If the field lenght is too small, those control characters will be truncated with no error from the system that they were not included with your data. As it is, the bug dont show up until you are trying to retrieve the data with the &#8220;unserialize()&#8221; function. Of course, with some of the control characters missing, the retrieval fails. This  also explains, why trim() will work in some cases, depending on how much white space is can be removed with the trim(). For a permanent fix, increase the feild lenght in the database by a few characters to include the serialize control characters especially so if the data to be stored will vary in size.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Powell</title>
		<link>http://ryanbosinger.com/blog/2009/php-unserialize-error-at-offset-simple-solution/comment-page-1/#comment-9248</link>
		<dc:creator>Joshua Powell</dc:creator>
		<pubDate>Tue, 27 Apr 2010 01:06:49 +0000</pubDate>
		<guid isPermaLink="false">http://ryanbosinger.com/blog/?p=95#comment-9248</guid>
		<description>Thanks for the fix, worked out great for me. Kept getting that pesky &quot;Error at offset&quot; error.

I have been programming with PHP for at least 5 years and I have never come across this error until now. You mentioned you were using Codeigniter because this is the first time I have run into the error and I was using Expression Engine which is based on Codeigniter.

Again thanks for the tip. Using trim() worked great.</description>
		<content:encoded><![CDATA[<p>Thanks for the fix, worked out great for me. Kept getting that pesky &#8220;Error at offset&#8221; error.</p>
<p>I have been programming with PHP for at least 5 years and I have never come across this error until now. You mentioned you were using Codeigniter because this is the first time I have run into the error and I was using Expression Engine which is based on Codeigniter.</p>
<p>Again thanks for the tip. Using trim() worked great.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
