- var_export: documentation ( source)
- array_filter: documentation ( source)
- str_ends_with: documentation ( source)
<?php
$array = ['one.php', 'two.txt'];
var_export(
array_filter(
$array,
fn($v) => str_ends_with($v, '.txt')
)
);