Well, there’s two different paths here; parsing a JSON, and parsing specifically this array-string. I shall assume the latter for the moment. $result->types = explode(",",str_replace(array("[","]",'"'), "",$result->types));
Can you do it “directly”? no. PDO doesnt have a column type for JSON.
I am also not a big fan, but there are situations where it makes perfectly sense. For example for settings with a multi select. You can of course create another table for each option and then create a cross reference table for the selected once, but as this values are rarely updated and never searched for it is not needed. Here you put them in an JSON array in one column and you are fine by fetching them once for your user and that’s it.
Searching in a json block is super fast. I didn’t believed it also, but I have seen some benchmarks and you can find a value of one attribute in a JSON object as fast as if you search for a string in a specific column. Of course only if you have no index on any column. You can also create a column always containing the value of one attribute of the JSON object and then add an index on it. Then the database is able to search with index in JSON.
It is amazing what they have developed. But as I said. I am not a big fan either.