<?php
$texto = '
1ª Temporada - Nome da temporada
01 - Nome do ep um
02 - Nome do ep dois
03 - Nome do ep três
2ª Temporada - Nome da temporada
01 - Nome do ep um
02 - Nome do ep dois
03 - Nome do ep três
' ;
$pattern = "/[\d].*/" ;
$x = 1 ;
foreach ( $matches [ 0 ] as $items ) {
$episodios [ $x ] = array ( ) ; $x ++;
} else {
$episodios [ $x - 1 ] [ ] = $items ;
}
}
PD9waHAKCiR0ZXh0byA9ICcKMcKqIFRlbXBvcmFkYSAtIE5vbWUgZGEgdGVtcG9yYWRhCjAxIC0gTm9tZSBkbyBlcCB1bQowMiAtIE5vbWUgZG8gZXAgZG9pcwowMyAtIE5vbWUgZG8gZXAgdHLDqnMKMsKqIFRlbXBvcmFkYSAtIE5vbWUgZGEgdGVtcG9yYWRhCjAxIC0gTm9tZSBkbyBlcCB1bQowMiAtIE5vbWUgZG8gZXAgZG9pcwowMyAtIE5vbWUgZG8gZXAgdHLDqnMKJzsKCiRwYXR0ZXJuID0gIi9bXGRdLiovIjsKJHJlc3VsdGFkbyA9IHByZWdfbWF0Y2hfYWxsKCRwYXR0ZXJuLCAkdGV4dG8sICRtYXRjaGVzKTsKCiRlcGlzb2Rpb3MgPSBhcnJheSgpOwoKJHggPSAxOwpmb3JlYWNoKCRtYXRjaGVzWzBdIGFzICRpdGVtcyl7CiAgIGlmKHN0cmlzdHIoJGl0ZW1zLCAnVGVtcG9yYWRhJykpewogICAgICAkZXBpc29kaW9zWyR4XSA9IGFycmF5KCk7CiAgICAgICR4Kys7CiAgIH1lbHNlewogICAgICAkZXBpc29kaW9zWyR4LTFdW10gPSAkaXRlbXM7CiAgIH0KfQoKcHJpbnRfcigkZXBpc29kaW9zKTs=