diff --git a/example.php b/example.php index 6f0a85d..96277d2 100644 --- a/example.php +++ b/example.php @@ -15,3 +15,11 @@ echo Emoji\replace_emoji('I like 🌮 and 🌯')."\n"; +echo "\n"; + + +$string = "Trešnja 🍒"; +$emoji = Emoji\detect_emoji($string); +echo '.'.grapheme_substr($string, 0, $emoji[0]['grapheme_offset']).".\n"; +echo '.'.substr($string, 0, $emoji[0]['byte_offset']).".\n"; +