返回查询cakephp的int

I am trying to get an integer value of the amount field in my views tables. I am able to find the value but not return it as an int

$amount = $views
            ->find()
            ->select('amount')
            ->where(['date'=>$todaysdate])
            ->first();

        echo $amount;

this echos out { "amount": 2 }. How would i just get an int variable with the 2?

In your case, you should use: echo $amount->amount. You should spend some time reading the documentation.