i found out myself (its stored in wp_postmeta table)
this is one of the entries from the table
a:5:{s:5:"image";s:8:"sample.png";s:10:"sub-images";a:0:{}s:4:"link";s:0:"";s:5:"price";s:1:"0";s:12:"product-code";s:0:"";}
can anyone please tell me how can i access the name of the image from it (sample.png)? like how can i parse this thing using php.
the ‘s:8’ thing before the image name is unique. Is there a function in php to get it like ‘objectForKey@”s:8″‘ ?
Please help
blogatom,
The strange format you are unfamiliar with is a serialized PHP array, the notation allows PHP to rebuild the object with all it’s variables and data intact. You may serialize and un-searlize any data you wish with PHP, look online for more information.
You may also use the built in WordPress function get_post_meta to get the data array from the database, this will most likely be the most efficient method of data retrieval.
<?php get_post_meta(get_the_ID(), 'catablog-post-meta', true); ?>