Syntax ERROR: A non well formed numeric value encountered

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.

Tagged : / / / /