• Hello

    I want to get and echo some value from the _ihfc_hotel array

    so i have this code $item = get_post_meta($post->ID, ‘_ihfc_hotel’);

    and then echo $item[‘name’];

    but when i load the page i receive this error:

    Warning: Illegal string offset ‘name’ in /Applications/MAMP/htdocs/wp_test_csv/wp-content/themes/twentysixteen/template-parts/content-single.php on line 33

    if i print the entire array with print_r($item) i retrieve an array like this

    Array ( [0] => a:39:{s:2:”id”;s:6:”703981″;s:4:”name”;s:10:”Bilton Apt”;s:7:”address”;s:25:”Hart Blvd, Paradise Acres”;s:3:”zip”;s:2:”PO”;s:10:”city_hotel”;s:11:”Montego Bay”;s:3: …etc…

    can you help me

  • The topic ‘Print Array value from _ihfc_hotel meta key’ is closed to new replies.