When you using @foreach value in a variable in your blade file and put any value and using any Mathematics function in your value for showing your document this type of error.
@foreach($allcourses as $i => $allclass)
<p>{{$allclass['total_fees_of_class']}}</p>
<?php
$fee = $allclass['total_fees_of_class'];
$c = ($fee);
$a = (100);
$d = (20);
$e = $c * $d / $a;
$fee = $c + $e;
?>
<span>
<b>{{$fee}}</b>
</span>
@endforeach
Then, You can add (int) as prefix in your foreach value as “$c = (int)($fee);” and write as below code
<?php
$fee = $allclass['total_fees_of_class'];
$c = (int)($fee);
$a = (100);
$d = (20);
$e = $c * $d / $a;
$fee = $c + $e;
?>
Your program will run.
Latest posts by rajeshkumar (see all)
- AWS Error: Access denied by EC2 Instance Connect - December 4, 2023
- How to get Blackduck Trial version? - December 3, 2023
- PHP ionCube Error: cannot be decoded by this version of the ionCube Loader - December 2, 2023