"PHP" / Говнокод #7991 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
<?
$thePrice = $iblockelem[ "PROPERTIES" ][ "PRICE" ][ "VALUE" ];
$thePrice_s = '';
if(strlen(trim($thePrice))>3)
{
	$priceArray = str_split($thePrice);
	$priceArray = array_reverse($priceArray);
	for($i = 1; $i <= count($priceArray); $i++)
	{
		$thePrice_s.=$priceArray[$i-1];
		if(($i%3)==0)
			$thePrice_s.=' ';
	}
	$thePrice = str_split($thePrice_s);
}
echo rtrim(ltrim(implode(array_reverse($thePrice))))

?>

<?=number_format($thePrice,0,"."," ")?>

Запостил: fon-neiman fon-neiman, (Updated )

Комментарии (2) RSS

Добавить комментарий

Помни, guest, за тобой могут следить!

    А не использовать ли нам bbcode?


    8