3v4l.org

run code in 300+ PHP versions simultaneously
<?php if ( version_compare(PHP_VERSION, '8.1.0') < 0 ) { ini_set("auto_detect_line_endings", true); } $nl = "\r"; $lastnl = "\r\n"; $text = "field1;field2$nl" . "Jean-Louis s'est fait;mordre par un ragondin.$nl" . "Claudette mange de la;choucroute en cachette.$nl" . "Bogdan joue à Hippo-Glouton;avec son cousin.$lastnl"; $URI = 'data://text/plain;base64,' . base64_encode($text); $lines = file($URI, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES); var_dump($lines);

preferences:
48.26 ms | 408 KiB | 5 Q