PHP Doku:: Basic usage of this extension - intl.examples.basic.html

Verlauf / Chronik / History: (11) anzeigen

Sie sind hier:
Doku-Startseite ≥ PHP-Handbuch ≥ Funktionsreferenz ≥ Unterstützung menschlicher Sprache und Zeichenkodierung ≥ Internationalization Functions ≥ Beispiele ≥ Basic usage of this extension

Ein Service von Reinhard Neidl - Webprogrammierung.

Beispiele

<<Beispiele

The Collator class>>

Basic usage of this extension

Each module provides two kind of APIs: a procedural one and an object oriented one. Both are actually identical and described in the corresponding document.

Hinweis:

All input strings must be in UTF-8 encoding. All output strings are also in UTF-8.

Beispiel #1 Example of using the procedural API

<?php
$coll  
= collator_create('en_US');
$result = collator_compare($coll, "string#1", "string#2");
?>

Beispiel #2 Example of using the object-oriented API

<?php
$coll 
= new Collator('en_US');
$al   = $coll->getLocale(Locale::ACTUAL_LOCALE);
echo 
"Actual locale: $al\n";

$formatter = new NumberFormatter('en_US', NumberFormatter::DECIMAL);
echo 
$formatter->format(1234567);
?>

Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)