title: Can't unserialize a string in php
body: <p>Yes, i know. I see a lot of questions about it.</p>
  
  <p>But no one works for me until now.</p>
  
  <p>I have a blog in wordpress who use serialized data for store some custom fields.
  It works great, but when i moved all the blog to another folder, all serialized data gonne from wordpress (but it stills in the database)
  So, wordpress don't detect it.</p>
  
  <p>Now... i'm figthing with the code to know why isn't working.
  At the end... i just thinked, well, i gonna do a code for get the serialized data and it will work.</p>
  
  <p>Now i'm lost, i have this:</p>
  
  <pre><code>$data = 'a:7:{s:4:"zoom";s:2:"18";s:8:"latitude";s:8:"41.37233";s:9:"longitude";s:7:"1.04283";s:11:"address_one";s:16:"Finca Riudabella";s:11:"address_two";s:33:" s/n - 43430 Vimbodí (Tarragona)";s:3:"pin";s:77:"http://espaciosparaeventos.es/wp-content/uploads/2012/02/fincas.png";s:6:"bg_img";s:0:"";}';
  $data = "a:7:{s:4:1}";
  $data = trim($data);
  var_dump($data);
  var_dump(unserialize($data));
  </code></pre>
  
  <p>I tried with an original serialized string from the database (the fisrt line) and returns false and a error.
  I done one a little bit simple, and say the same.</p>
  
  <p>My error is: </p>
  
  <pre><code>Notice: unserialize() [function.unserialize]: Error at offset 5 of 11 bytes in C:\xampp\htdocs\unser.php on line 6
  bool(false) 
  </code></pre>
  
  <p>So, i don't know why i can't get data from the string!</p>
  
  <p>I tried this tool <a href="http://unserialize.net/serialize" rel="nofollow">http://unserialize.net/serialize</a> and my data work just as expected :\ i need to do something else?</p>