I have a string that is sent to my JavaScript via PHP that looks like this:
var string = "[ 'string 1','string 2 ','string 3' ]"
I want to split this string and get rid of the symbols [, ] and ' to produce the array
var array = {
string 1,
string 2,
string 3,
}
My current method uses a bunch of replaces, splits and loops. It seems very inefficient, and I want a better/more efficient method.
[, not{.