I have an object $stdClassObject that's created by json_decode. It's for train schedules. I need to be able to create a new object which contains just those trains heading east bound. I'm at a loss of how to do this since I'm very new to Objects in PHP. Here is the PHP code I've isolate $trips[$ny_trip]:
// $stdClassObject originally created by json_decode
foreach ($trips as $ny_trip=>$ny_trip_info) {
if (East_Bound($ny_trip_info->DESTINATION)) {
// Copy or clone(?) $trips[$ny_trip]) to an object called east_bound
...
}
}