Hej
Mam takiego regexa, i odczytuje sobie tablicę, chciałbym zmienić jej klucze, czy mogę to zrobić tak jak na przykładzie poniżej, czy jest lepsze rozwiązanie?
preg_match("/(([0-9]{2})([0-9]{2})([0-9]{2}))([0-9]{3}([0-9]{1}))([0-9]{1})/", "97121103216", $matches);
$matchesa = [];
$matchesa["pesel"] = $matches[0];
$matchesa["data"] = $matches[1];
$matchesa["rok"] = $matches[2];
$matchesa["miesiac"] = $matches[3];
$matchesa["dzien"] = $matches[4];
$matchesa["sr_no_plec"] = $matches[5];
$matchesa["plec"] = $matches[6];
$matchesa["kontrolna"] = $matches[7];
unset($matches);