IntlChar::enumCharTypes

(PHP 7, PHP 8)

IntlChar::enumCharTypesEnumerate all code points with their Unicode general categories

Beschreibung

public static IntlChar::enumCharTypes(callable $callback): void

Enumerates efficiently all code points with their Unicode general categories. This is useful for building data structures, for enumerating all assigned code points, etc.

For each contiguous range of code points with a given general category ("character type"), the callback function is called. Adjacent ranges have different types. The Unicode Standard guarantees that the numeric value of the type is 0..31.

Parameter-Liste

callback

The function that is to be called for each contiguous range of code points with the same general category. The following three arguments will be passed into it:

  • int $start - The starting code point of the range
  • int $end - The ending code point of the range
  • int $name - The category type (one of the IntlChar::CHAR_CATEGORY_* constants)

Rückgabewerte

Es wird kein Wert zurückgegeben.

Beispiele

Beispiel #1 Enumerating over a sample range of code points

<?php
IntlChar
::enumCharTypes(function($start$end$type) {
    
printf("U+%04x through U+%04x are in category %d\n"$start$end$type);
});
?>

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

U+0000 through U+0020 are in category 15
U+0020 through U+0021 are in category 12
U+0021 through U+0024 are in category 23
U+0024 through U+0025 are in category 25
U+0025 through U+0028 are in category 23
U+0028 through U+0029 are in category 20
U+0029 through U+002a are in category 21
U+002a through U+002b are in category 23
U+002b through U+002c are in category 24
U+002c through U+002d are in category 23
U+002d through U+002e are in category 19
U+002e through U+0030 are in category 23
U+0030 through U+003a are in category 9
...

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Grundlagen von Views in MySQL

Views in einer MySQL-Datenbank bieten die Möglichkeit, eine virtuelle Tabelle basierend auf dem Ergebnis einer SQL-Abfrage zu erstellen. ...

admin

Autor : admin
Kategorie: mySQL-Tutorials

Definition von Stored Procedures - eine Einführung

Stored Procedures sind vordefinierte SQL-Codeblöcke, die in einer Datenbank gespeichert sind und bei Bedarf aufgerufen werden können. ...

Bernie

Autor : ebiz-consult GmbH & Co. KG
Kategorie: mySQL-Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Spielplan für 4 Gruppen zu je 6 Teams auf 2 Feldern

Hey, hallöchen! Du musst die Spiele so durchgehen, dass die Platzierung kontrolliert wechseln, dass jedes Team auf den Plätzen spielt. Hier ist ...

Geschrieben von Nico_Schubert am 14.05.2024 07:17:28
Forum: PHP Developer Forum
Bild drehen

Hallo, Du hast den Drehwinkel und den Pfad zum Bild bereits richtig im Post-Array. Hier ist ein vollständiges Beispiel, wie du das Bild drehst u ...

Geschrieben von Nico_Schubert am 14.05.2024 06:55:15
Forum: PHP Developer Forum
Berechnungen durchführen

Hallo Matze, gerne helfe ich dir bei deinem Projekt. Lass uns deine Fragen Schritt für Schritt angehen: Erste Frage: Ist das Konstrukt so richt ...

Geschrieben von Nico_Schubert am 14.05.2024 06:43:13
Forum: PHP Developer Forum
Bild drehen

Ich denke, dass die Aussage von scatello richtig ist und stimme ihm zu.

Geschrieben von LucyCoffee am 10.05.2024 12:04:18
Forum: PHP Developer Forum