Warning: A non-numeric value encountered

后端 未结 18 1860
抹茶落季
抹茶落季 2020-11-22 06:15

Recently updated to PHP 7.1 and start getting following error

Warning: A non-numeric value encountered in on line 29

Here is wha

18条回答
  •  不要未来只要你来
    2020-11-22 06:34

    If non-numeric value encountered in your code try below one. The below code is converted to float.

    $PlannedAmount = ''; // empty string ''
    
    if(!is_numeric($PlannedAmount)) {
               $PlannedAmount = floatval($PlannedAmount);
     }
    
     echo $PlannedAmount; //output = 0
    

提交回复
热议问题