Hi,
I am creating an import using WP All Import in Wordpress and I've been told by their support that I have to write some custom code to create a nested serialised PHP array.
The serialised array has to end up looking like this:
s:287:"a:8:{s:5:"price";a:2:{s:5:"value";s:5:"38000";s:8:"original";s:0:"";}s:17:"custom_tax_inside";s:0:"";s:15:"custom_tax_page";s:0:"";s:8:"city_mpg";a:1:{s:5:"value";s:0:"";}s:11:"highway_mpg";a:1:{s:5:"value";s:0:"";}s:12:"custom_badge";s:0:"";s:5:"video";s:0:"";s:10:"short_desc";s:0:"";}";
Can you give me any advice on how I can:
a) See what this nested serialised array actually looks like
b) How I can code a nested serialised array like this
Once I can do this I plan to put it into a hook for when WP All Import is importing and this will allow me to import certain values (like price) into my car database.
Any input from anyone in the community would be much appreciated.
Bonus Point: I have another field that containst he following serialised array:
a:7:{i:0;s:38:"Multi-function Control Screen - Colour";i:1;s:17:"11 Speaker Stereo";i:2;s:15:"Online Services";i:3;s:19:"18inch Alloy Wheels";i:4;s:21:"Power - Tailgate/Boot";i:5;s:45:"Power Door Mirrors - Auto Dipping (Reversing)";i:6;s:13:"Driving Lamps";}
When I put this into 'http://www.unserialize.com/' I get the following:
'Array
( [0] => Multi-function Control Screen - Colour [1] => 11 Speaker Stereo [2] => Online Services [3] => 18inch Alloy Wheels [4] => Power - Tailgate/Boot [5] => Power Door Mirrors - Auto Dipping (Reversing) [6] => Driving Lamps )'
However when I type in the following:
s:287:"a:8:{s:5:"price";a:2:{s:5:"value";s:5:"38000";s:8:"original";s:0:"";}s:17:"custom_tax_inside";s:0:"";s:15:"custom_tax_page";s:0:"";s:8:"city_mpg";a:1:{s:5:"value";s:0:"";}s:11:"highway_mpg";a:1:{s:5:"value";s:0:"";}s:12:"custom_badge";s:0:"";s:5:"video";s:0:"";s:10:"short_desc";s:0:"";}";
I get the following:
s:287:"a:8:{s:5:"price";a:2:{s:5:"value";s:5:"38000";s:8:"original";s:0:"";}s:17:"custom_tax_inside";s:0:"";s:15:"custom_tax_page";s:0:"";s:8:"city_mpg";a:1:{s:5:"value";s:0:"";}s:11:"highway_mpg";a:1:{s:5:"value";s:0:"";}s:12:"custom_badge";s:0:"";s:5:"video";s:0:"";s:10:"short_desc";s:0:"";}";
I just get a string with no array values - what am I doing wrong? Is there something wrong with the serialised array above?