I have a column in the database that saves free text, and together it saves some data within [ ]
is to find only what is inside [ ]
in this string to convert it into an array.
Example:
$texto = "Hoje fomos até São Paulo visitar o paciente, [236,AD-BF] e não foi possível chegar a um diagnóstico";
I would like to extract only [236,AD-BF]
and turn it into array.
Is there any way to do it?
$array = explode(',',$texto);