title: How to solve a non well formed numeric value encountered in PHP?
body: <p>I am having an error. A non well formed numeric value encountered. Kindly check my code below and guide me what I am doing wrong:</p>
  <pre><code>...
      $i++;
      $item_count += $item['quantity'];
      $sub_total += ($product['price'] * $item['quantity']);
      $sub_total = (float)$sub_total;
  
  }
  $tax_rate = 18;
  
  $tax = ($tax_rate * $sub_total) / 100;
  // Here I am having an error - A non well formed numeric value encountered
  $tax = number_format($tax, 2); // 2 decimal digit
  $grand_total = $tax + $sub_total;
  </code></pre>
  <p>Kindly suggest what I am doing wrong.
  Your suggestions would be welcome.
  Thank You</p>