3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array('iso'=>'A3+', 'height'=>329, 'width'=>483, 'descrip'=>'A3+ (329 x 483 mm)'), array('iso'=>'A3_EXTRA', 'height'=>322, 'width'=>445, 'descrip'=>'A3 EXTRA (322 x 445 mm)'), array('iso'=>'A3_SUPER', 'height'=>305, 'width'=>508, 'descrip'=>'A3 SUPER (305 x 508 mm)'), array('iso'=>'SUPER_A3', 'height'=>305, 'width'=>487, 'descrip'=>'SUPER A3 (305 x 487 mm)'), array('iso'=>'A4_EXTRA', 'height'=>235, 'width'=>322, 'descrip'=>'A4 EXTRA (235 x 322 mm)'), array('iso'=>'A4_SUPER', 'height'=>229, 'width'=>322, 'descrip'=>'A4 SUPER (229 x 322 mm)'), array('iso'=>'SUPER_A4', 'height'=>227, 'width'=>356, 'descrip'=>'SUPER A4 (227 x 356 mm)'), array('iso'=>'A4_LONG', 'height'=>210, 'width'=>348, 'descrip'=>'A4 LONG (210 x 348 mm)'), array('iso'=>'F4', 'height'=>210, 'width'=>330, 'descrip'=>'F4 (210 x 330 mm)'), array('iso'=>'SO_B5_EXTRA', 'height'=>202, 'width'=>276, 'descrip'=>'SO B5 EXTRA (202 x 276 mm)'), array('iso'=>'A5_EXTRA', 'height'=>173, 'width'=>235, 'descrip'=>'A5 EXTRA (173 x 235 mm)'), array('iso'=>'ANSI_E', 'height'=>863.6, 'width'=>1117.6, 'descrip'=>'ANSI E (863.6 x 1117.6 mm)'), array('iso'=>'ANSI_D', 'height'=>558.8, 'width'=>863.6, 'descrip'=>'ANSI D (558.8 x 863.6 mm)'), array('iso'=>'ANSI_C', 'height'=>431.8, 'width'=>558.8, 'descrip'=>'ANSI C (431.8 x 558.8 mm)'), array('iso'=>'ANSI_B', 'height'=>279.4, 'width'=>431.8, 'descrip'=>'ANSI B (279.4 x 431.8 mm)'), array('iso'=>'ANSI_A', 'height'=>215.9, 'width'=>279.4, 'descrip'=>'ANSI A (215.9 x 279.4 mm)'), ); $filter = "A4"; $filt = array_filter($arr, function($e) { strcasecmp(substr($e['iso'], 0, strlen($filter)), $filter) === 0; }); var_dump($filt);

preferences:
51.13 ms | 402 KiB | 5 Q