- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$text = <<<EOD
[a-1]******************
[b-2]**********
[c-3]***
EOD;
preg_match_all('/^\[([a-z]-\d)](.*?)$/m' , $text, $matches, PREG_SET_ORDER);
$result = array();
foreach ($matches as $match) {
$result[$match[1]] = $match[2];
}
var_dump($result);