There is a certain text (template), in it sometimes there are lines of the form:
[if (health == 1) then (var1) else (var2)]
How to make so that in PHP the given construction is processed, where: health = is the real variable that is in the script, and the output should be an array, with the results (because there can be several such constructions. The array should contain either var1, or var2 (based on this example, i.e. the array contains the contents of the brackets, depending on the construction.)