php - Display json array -
i trying read api have implemented wordpress using wp-api v2, have used several plugins return information need.
the source json can found here.
i need return pure_taxonomies->property-status->name
.
i have tried following blank page:
foreach($select_api $p) { echo ' status:'.$p->pure_taxonomies->property-status->name.' '; }
any great!
first of all, if have json_encoded string, should decode json_decode() decoded json , array 2 elements. error because of hyphen property-status in name of property. should use curly braces:
status:'.$p->pure_taxonomies->{"property-status"}[0]->name.'
important.
use curly braces property names hyphen
don't forget in structure property-status array. that's why used index 0 first element
Comments
Post a Comment