There is a line like:
some text [tagname = "param1"] some text [/ tagname] some other text
You need to parse the text using PHP tools, pull each similar construction out of it, and write each into a dictionary like:
[ ['name' => 'Tagname', 'param' => 'param1', 'data' => 'some text'], ... ] I tried to make it so that at first parse at least opening tags:
$string1 = "some text[AAA=\"bbb\"]some stuff[/AAA]some more text[sdfsf=\"bbb\"]some stuff[/sdfsf] sdfsdfsdfs"; $reg1 = "#\[[Az]\=\"[Az]\"\]#"; $matches = []; preg_match_all($reg1, $string1, $matches); print_r($matches); but matches with the template are not output to the array. Only one empty element is visible. Maybe preg_match_all is doing something not exactly what I imagine, and need some other functions?
[Az]+, otherwise only 1 letter should be. Yes, and the intervalAzis not only Latin letters. - Visman[, something likestrpos('['). - user207618