title: unserialize not working
body: <p>i am trying to unserialize string that is stored in mysql table. </p>
  
  <p>following is the string stored in mysql table.</p>
  
  <pre><code>a:3:{s:15:\"purchase_amount\";d:500;s:4:\"more\";d:7;s:4:\"less\";d:11.5;}
  </code></pre>
  
  <p>at the time of insertion i had written following code.</p>
  
  <pre><code>addslashes(serialize(array('purchase_amount' =&gt; $values['purchase_amount'], 'more' =&gt; $values['transportaion_cost_gretter'], 'less' =&gt; $values['transportaion_cost_lesser'])))
  </code></pre>
  
  <p>At retrieval i had written followin code.</p>
  
  <pre><code>unserialize(stripslashes($row-&gt;getTransportaionCost()));
  </code></pre>
  
  <p>i am getting following error.</p>
  
  <pre><code>Notice: unserialize() [function.unserialize]: Error at offset 5 of 98 bytes 
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>i tried json_encode and json_decode...</p>
  
  <p>following is json data in mysql table</p>
  
  <pre><code>{"purchase_amount":500,"more":7,"less":11.5}
  </code></pre>
  
  <p>Following is the json decode in php.</p>
  
  <pre><code>var_dump(json_decode($row-&gt;getTransportaionCost())); //null
  </code></pre>
  
  <p>can any one tell me what is the problem ?</p>