<?php
$str = '1ª Temporada – Shinigami Daikou
001. O Dia em que me Tornei Shinigami
002. Um Trabalho de Shinigami
003. O Desejo do Irmão mais Velho, o Desejo da Irmã mais Nova
004. Periquito Amaldiçoado
2ª Temporada – Invasão a Soul Society
026. Formação! A Pior Companhia
027. Libere o Golpe Final!
028. Orihime está sendo Visada
3ª Temporada – Fuga da Soul Society
052. Renji, Juramento da Alma! Luta Mortal com Byakuya
053. A Tentação de Ichimaru Gin, Resolução da Destruição
054. Um Juramento Realizado! Pegue Rukia Devolta' ;
$ultima_temporada = 0 ;
foreach ( $linhas as $value ) {
if ( preg_match ( '#(\d+)ª[^a-z]+?temporada#i' , $value , $temporada ) ) {
$ultima_temporada = intval ( $temporada [ 1 ] ) ; $filmes [ $ultima_temporada ] = array ( ) ;
} else if ( preg_match ( '#(\d+)[^a-z]+([a-z].*?)$#i' , $value , $episodio ) ) {
$filmes [ $ultima_temporada ] [ intval ( $episodio [ 1 ] ) ] = $episodio [ 2 ] ;
}
}
PD9waHAKIAokZmlsbWVzID0gYXJyYXkoKTsKIAokc3RyID0gJzHCqiBUZW1wb3JhZGEg4oCTIFNoaW5pZ2FtaSBEYWlrb3UKMDAxLiBPIERpYSBlbSBxdWUgbWUgVG9ybmVpIFNoaW5pZ2FtaQowMDIuIFVtIFRyYWJhbGhvIGRlIFNoaW5pZ2FtaQowMDMuIE8gRGVzZWpvIGRvIElybcOjbyBtYWlzIFZlbGhvLCBvIERlc2VqbyBkYSBJcm3DoyBtYWlzIE5vdmEKMDA0LiBQZXJpcXVpdG8gQW1hbGRpw6dvYWRvCjLCqiBUZW1wb3JhZGEg4oCTIEludmFzw6NvIGEgU291bCBTb2NpZXR5CjAyNi4gRm9ybWHDp8OjbyEgQSBQaW9yIENvbXBhbmhpYQowMjcuIExpYmVyZSBvIEdvbHBlIEZpbmFsIQowMjguIE9yaWhpbWUgZXN0w6Egc2VuZG8gVmlzYWRhCjPCqiBUZW1wb3JhZGEg4oCTIEZ1Z2EgZGEgU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