3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = ['one.php', 'two.txt']; $found = false; foreach ($array as $filename) { if (str_ends_with($filename, '.txt')) { $found = true; break; } } var_export($found);

preferences:
29.45 ms | 405 KiB | 5 Q