3v4l.org

run code in 300+ PHP versions simultaneously
<?php $row = 'ARTISTA - BRANO - ANNO'; \preg_match_all('/[a-zA-Z]+/', $row, $matches ); var_dump( $matches ); $row = 'ARTISTA -'; \preg_match_all('/[a-zA-Z]+/', $row, $matches ); var_dump( $matches );
based on t4R7j
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.23, 7.4.0 - 7.4.13, 8.0.0
array(1) { [0]=> array(3) { [0]=> string(7) "ARTISTA" [1]=> string(5) "BRANO" [2]=> string(4) "ANNO" } } array(1) { [0]=> array(1) { [0]=> string(7) "ARTISTA" } }