3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file = 'ыыыыыыыы'; if (function_exists('transliterator_transliterate') && function_exists('iconv')) { echo 'ICONV Available' .PHP_EOL; } // Remove any trailing dots, as those aren't ever valid file names. $file = rtrim($file, '.'); // Try transliterating the file name using the native php function if (function_exists('transliterator_transliterate') && function_exists('iconv')) { echo 'transliterating YES' .PHP_EOL; // Using iconv to ignore characters that can't be transliterated $file = iconv("UTF-8", "ASCII//TRANSLIT//IGNORE", transliterator_transliterate('Any-Latin; Latin-ASCII; Lower()', $file)); } $regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#'); $name = trim(preg_replace($regex, '', $file)); var_dump($name);
Output for git.master, git.master_jit, rfc.property-hooks
ICONV Available transliterating YES string(8) "yyyyyyyy"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
181.95 ms | 405 KiB | 5 Q