I have an object:
stdClass Object
(
[Color] => Red
[Shape] => Round
[Taste] => Sweet
)
I want to trim each of the elements in the object and if that element is empty, set it to 'N/A'
So this object:
stdClass Object
(
[Color] => Red
[Shape] =>
[Taste] => Sweet
)
Would become this:
stdClass Object
(
[Color] => Red
[Shape] => N/A
[Taste] => Sweet
)
How should I accomplish this, array_walk maybe?