symfony/polyfill-intl-grapheme

Symfony polyfill for intl's grapheme_* functions

PHP

1,729

90 commits

updated Sep 30, 2026

See the code

README

Symfony Polyfill / Intl: Grapheme

This component provides a partial, native PHP implementation of the Grapheme functions from the Intl extension.

  • grapheme_extract: Extract a sequence of grapheme clusters from a text buffer, which must be encoded in UTF-8
  • grapheme_stripos: Find position (in grapheme units) of first occurrence of a case-insensitive string
  • grapheme_stristr: Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack
  • grapheme_strlen: Get string length in grapheme units
  • grapheme_strpos: Find position (in grapheme units) of first occurrence of a string
  • grapheme_strripos: Find position (in grapheme units) of last occurrence of a case-insensitive string
  • grapheme_strrpos: Find position (in grapheme units) of last occurrence of a string
  • grapheme_strstr: Returns part of haystack string from the first occurrence of needle to the end of haystack
  • grapheme_substr: Return part of a string
  • grapheme_str_split: Splits a string into an array of individual or chunks of graphemes

More information can be found in the main Polyfill README.

License

This library is released under the MIT license.

compatibility
component
grapheme
intl
javascript
polyfill
portable
shim
symfony
symfony-component
symfony-polyfill

symfony/polyfill-intl-grapheme

Symfony polyfill for intl's grapheme_* functions

PHP

1,729

90 commits

updated Sep 30, 2026

See the code

README

Symfony Polyfill / Intl: Grapheme

This component provides a partial, native PHP implementation of the Grapheme functions from the Intl extension.

  • grapheme_extract: Extract a sequence of grapheme clusters from a text buffer, which must be encoded in UTF-8
  • grapheme_stripos: Find position (in grapheme units) of first occurrence of a case-insensitive string
  • grapheme_stristr: Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack
  • grapheme_strlen: Get string length in grapheme units
  • grapheme_strpos: Find position (in grapheme units) of first occurrence of a string
  • grapheme_strripos: Find position (in grapheme units) of last occurrence of a case-insensitive string
  • grapheme_strrpos: Find position (in grapheme units) of last occurrence of a string
  • grapheme_strstr: Returns part of haystack string from the first occurrence of needle to the end of haystack
  • grapheme_substr: Return part of a string
  • grapheme_str_split: Splits a string into an array of individual or chunks of graphemes

More information can be found in the main Polyfill README.

License

This library is released under the MIT license.

compatibility
component
grapheme
intl
javascript
polyfill
portable
shim
symfony
symfony-component
symfony-polyfill

Project health

Overall

4.0/10

Maintained

7/10

Code review

0/10
OpenSSF Scorecard

Significant stargazers

Javier Eguiluz

1,668 followers · starred Nov 2017

Oskar Stark

327 followers · starred Feb 2020

Derick Rethans

1,840 followers · starred Feb 2021

Kyle

394 followers · starred Sep 2020