fork download
  1. <?php
  2.  
  3. $strings = array(
  4. '99-01[10-10-2010]',
  5. '29-02[10-11-2011]',
  6. '95-03[10-12-2013]',
  7. '88-04[10-10-2015]',
  8. '59-06[11-12-2016]'
  9. );
  10.  
  11. foreach( $strings as $s ) echo 'ALL'.strstr( $s, '-' ) . "\n";
Success #stdin #stdout 0.02s 52432KB
stdin
Standard input is empty
stdout
ALL-01[10-10-2010]
ALL-02[10-11-2011]
ALL-03[10-12-2013]
ALL-04[10-10-2015]
ALL-06[11-12-2016]