Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter blogatom

    (@blogatom)

    i found out myself (its stored in wp_postmeta table)

    Thread Starter blogatom

    (@blogatom)

    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

    Plugin Author macguru2000

    (@macguru2000)

    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); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: CataBlog] access images directly’ is closed to new replies.