3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<'STR' Andrés Cortez الخوارزمی 'Namnet på bildtävlingen' "नारी शक्त"--My---string--たけだ, まさゆき STR; $rules = <<<'RULES' :: Any-Latin; :: NFD; :: [:Nonspacing Mark:] Remove; :: NFC; :: [^-[:^Punctuation:]] Remove; :: Lower(); [:^L:] { [-] > ; [-] } [:^L:] > ; [-[:Separator:]]+ > '-'; RULES; $slug = \Transliterator::createFromRules($rules) ->transliterate( $string ); echo $slug;
Output for 5.5.0, 7.1.33, 7.2.0, 7.3.33, 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.13
andres-cortez-alkhwarzmy-namnet-pa-bildtavlingen-nari-sakta-my-string-takeda-masayuki
Output for 5.3.0 - 5.3.5, 5.4.0
Fatal error: Class 'Transliterator' not found in /in/ZTuZv on line 19
Process exited with code 255.

preferences:
60.76 ms | 407 KiB | 5 Q