1

I have this string

$string = '["a","b","c"],["a","b","c"],["a","b","c"],["a","b","c"]'

i need to convert that string in array like:

array(["a","b","c"],["a","b","c"],["a","b","c"],["a","b","c"])

Thankyou :)

1 Answer 1

6

If you wrap the $string in '[]', then you can decode it as JSON.

$data = json_decode('[' . $string . ']');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.