Your problem is that PHP's function
sizeof(...)
(also an alias on
count(...)
) returns the number of elements in an array. I guess if you use it on a scalar it will just return 1.
What you need to use here is the
int strlen(string $string)
function instead:
http://php.net/manual/en/function.strlen.php[
^]
80 $priceTmp = (string)$select["Price"];
81 while(strlen($priceTmp)%3 !=0)
82 {
83 $tmp = "0".$priceTmp;
84 $priceTmp = $tmp;
85 }
You are entering an endless loop as the modulus by 3 of one (constant) will never be 0.
As indicated in my modification of your code snippet you need to use
int strlen(string $string)
instead.
Best,
— Manfred