I have to parse wordpress post_meta table , particularly “_wp_attachment_metadata” field
For example:
Its value is for a post id = 99
> a:6:{s:5:"width";s:3:"238";s:6:"height";s:3:"179";s:14:"hwstring_small";s:23:"height='96'
> width='128'";s:4:"file";s:21:"2010/11/matt-lane.jpg";s:5:"sizes";a:1:{s:9:"thumbnail";a:3:{s:4:"file";s:21:"matt-lane-150x150.jpg";s:5:"width";s:3:"150";s:6:"height";s:3:"150";}}s:10:"image_meta";a:10:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";}}
I didnt understand how it is compiled or how it can be parsed outside wordpress. The thing i si have to load the latest articles with all the data sets of post on magento platform from wordpress.
please help me to parse this data to get the images src’s.
Thanks in advance
Try:
http://php.net/manual/en/function.unserialize.php
What I understand is:
There are two types of variables, for example:
a:6:
s:3:
a
= array and6
is the dimension of the arrays
= string and3
is the length of the stringThanks a lot for Craig quick answer.
Used the unserialize method and got everything from the string.
Here is the output, now can take any image from the wordpress post meta_data