note 44835 deleted from function.number-format by cmb
| From: | cmb@php.net | Date: | Sun, 13 Jan 2019 10:43:02 +0000 |
| Subject: | note 44835 deleted from function.number-format by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-210050@lists.php.net to get a copy of this message | ||
Note Submitter: drew at zitnay dot com
----
A more reliable and concise way of doing what S. Rahmel was trying to do below is as follows:
<?php
$field_inhalt = str_replace(array(".", ","), array("", "."),
$field_inhalt);
?>
The str_replace() call will first replace all dots with blanks, and then replace all commas with
dots. That way, it doesn't break down when you try a number over one million (i.e.
1.010.453,21).
Drew