Example 1 — Read the Decimal Point and Separator
Set the locale, then read the two most used keys.
<?php
setlocale(LC_ALL, "C");
$loc = localeconv();
echo "Decimal point: " . $loc["decimal_point"], PHP_EOL;
echo "Thousands sep: '" . $loc["thousands_sep"] . "'", PHP_EOL; How It Works
- Set a locale. The "C" locale is the plain default.
- Call localeconv. It returns an array.
- Read decimal_point. In the C locale it is a dot.
- Read thousands_sep. It is empty, so the quotes show nothing between them.

