Hello I'm trying to get the data for city, street address, postal code, country but I'm having hard time. This is from location field data of PODIO, it does not output anything. I know how to access the full address using this $items->fields['property-for-sale']->text
; but I want the individual parts.
<?php
include_once('auth.php');
$items = PodioItem::get(741801449);
$state = "";
$prop = $items->fields['property-for-sale']->values;
foreach ($prop as $property) {
$state .= $property->state;
}
echo "<pre>".print_r($prop,true)."</pre>";
echo $state;
?>
The variable state above and other does not output.
Below is the return array object from $prop variable above. Also I tried the syntax below, not working. Couldn't find any sample online or documentation for this.
//Tried this also but not working
$prop = $items->fields['property-for-sale']->values->state
$property['state']
$property['state']->text
$property['state']->humanized_value() //or humanized_value
Array
(
[city] => Seguin
[map_in_sync] => 1
[country] => United States
[formatted] => 656 N Hwy 123 Bypass #1, Seguin, TX 78155, USA
[value] => 656 N Hwy 123 Bypass #1, Seguin, TX 78155, USA
[state] => Texas
[postal_code] => 78155
[lat] => 29.5741442
[lng] => -97.9422569
[street_address] => 656 North Highway 123 Bypass
)
Any guidance would be highly appreciated.