neden bu number_format çalışmıyor?

2 Cevap php
       while($row = mysql_fetch_array($qry_result)){
       $price_to_show=$row['price'];
       number_format($price_to_show, 0, ',', ' ');
       echo $price_to_show;

Why doesnt the above give the space separator? It outputs the same as before the number format, what is wrong here?

Teşekkürler

2 Cevap

number_format () oldukça yerinde orijinali değiştirmek yerine, biçimlendirilmiş sayısını temsil eden yeni bir dize döndürür. Bu çalışması gerekir:

   $price_to_show = number_format($row['price'], 0, ',', ' ');
   echo $price_to_show;
   while($row = mysql_fetch_array($qry_result)){
   $price_to_show=number_format($row['price'], 0, ',', ' ');
   echo $price_to_show;
   }

biçimlendirilmiş numarasını döndürür number_format