Example 1 — Set the Locale
Set the C locale and print what PHP returns.
<?php
$result = setlocale(LC_ALL, "C");
echo $result, PHP_EOL; How It Works
- Pick a category. LC_ALL covers every category.
- Pass a locale name. C is always available.
- Read the return value. It is the name that is now active.
- Print it. You see C.

