Importing from XML is ignoring serialized custom field

I have recently had a lesson in serialized arrays from a friend and it all makes sense now!
After working this out it finally worked on the import.

Take this for example:
a:1:{s:7:”address”;s:50:”52, St. Michaels Rd,Sheffield,S359YN”;}

  • a:1: This is the array size, there is one piece of information in this array hense the 1.
  • a:size:{key definition;value definition;(repeated per element)}

  • s:7:”address”; This is the the size of the value. So for address there are 7 characters in the word address so the value size is 7.

  • s:size:value;

  • There is also integer values shown like this:

    • i:value;
  • Bolean values are shown like this:

    • b:value; (does not store “true” or “false”, does store ‘1’ or ‘0’)

that’s all there basically is in a serialized array to worry about, and when correct the wordpress importer will import these into the database with no problems, but if they are wrong then it escapes itself and leaves the field in the database row empty.

Examples:

String
 s:size:value;

 Integer
 i:value;

 Boolean
 b:value; (does not store "true" or "false", does store '1' or '0')

 Null
 N;

 Array
 a:size:{key definition;value definition;(repeated per element)}

 Object
 O:strlen(object name):object name:object size:{s:strlen(property name):property name:property definition;(repeated per property)}

 String values are always in double quotes
 Array keys are always integers or strings
    "null => 'value'" equates to 's:0:"";s:5:"value";',
    "true => 'value'" equates to 'i:1;s:5:"value";',
    "false => 'value'" equates to 'i:0;s:5:"value";',
    "array(whatever the contents) => 'value'" equates to an "illegal offset type" warning because you can't use an
    array as a key; however, if you use a variable containing an array as a key, it will equate to 's:5:"Array";s:5:"value";',
     and
    attempting to use an object as a key will result in the same behavior as using an array will.