The array prints out like this:
object(Postmaster_Rates)#2 (1) { ["_values:protected"]=> array(3) { ["currency"]=> string(3) "USD" ["charge"]=> int(580) ["service"]=> string(6) "GROUND" } }
How would I display this in a "nicer" form using foreach in php.
I tried this: (but it didn't echo out anything.)
foreach($result as $rate){
echo $rate['service'];
}
It's an array of "objects" you call it like echo $rate->service
Do you need to use foreach? You could also try: $array = (array) $yourObject;
Take a look at this at these two options.
// Cast to an array
$array = (array) $object;
// get_object_vars
$array = get_object_vars($object);
There are several answers here that can show you.