php8.5
Home/ Manual/ intl / locale/ Locale::getScript

Locale::getScript

PHP function Edit on GitHub ✎

(PHP 5 >= 5.3.0, PHP 7, PHP 8, PECL intl >= 1.0.0)

Gets the script for the input locale

Description

Oop

Locale::getScript(string $locale): string|null

Procedural

locale_get_script(string $locale): string|null

Gets the script for the input locale.

Parameters

locale

The locale to extract the script code from

Return Values

The script subtag for the locale or null if not present

Examples

locale_get_script() example

php
<?php
echo locale_get_script('sr-Cyrl');
?>

OO example

php
<?php
echo Locale::getScript('sr-Cyrl');
?>

The above example will output:

output
Cyrl

See Also

Source: reference/intl/locale/get-script.xml · from the official PHP manual (php/doc-en)