I have a list of params that I get from a specific shortcode I made available for users to provide.
Example of user input: This is my list of names: {{names("John", 'Mike', "O'connor")}}
From that, I have a regex to extract the list of params, so I get a string like: "John", 'Mike', "O'connor"
But now I need to convert this list to an array and the best way I can think is using json_decode, which can break as some users simply use single quotes.
What's the best way to convert this string into an array? Using str_replace to replace ' by " will also break the ' in the "O'connor" param.