I am new developer. I have a problem. I want all rating value sum then divided with 5. foreach show 325. I want result 3+2+5=10 then 10/5=2
foreach ($ratings as $ratingss) {
echo $ratingss->rating ;
}
var dump
object(stdClass)[571]
public 'id' => string '12' (length=2)
public 'hotel_id' => string '37' (length=2)
public 'rating' => string '3' (length=1)
object(stdClass)[300]
public 'id' => string '13' (length=2)
public 'hotel_id' => string '37' (length=2)
public 'rating' => string '5' (length=1)