Benjamin Benjamin - 6 months ago 22
PHP Question

Is there a way to get the list of available locales in PHP?

In Java, you can call

to get the list of available locales.

I was expecting an equivalent from the PHP Locale class, but could not find one.

Is there a way to get an array of all valid Locales?

Answer Source

I don't think there is a built in functions for this. You need to ask the operating system which locales are installed.

For example, if you run on a unix system you will need to execute the command:

$ locale -a
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download