1

I want to convert this string: ["5b09e23972929.png", "5b0a7f1361a00.png"] that I get from my MySQL database into an sequential array. The reason is I want to remove single parts of the string. So $string[0] should have the value 5b09e23972929.png is this case.

1
  • How did that get into your DB? You shouldn't store structured content like that. Commented May 27, 2018 at 19:54

1 Answer 1

2
$result = json_decode('["5b09e23972929.png", "5b0a7f1361a00.png"]');
Sign up to request clarification or add additional context in comments.

2 Comments

That code generates the Notice Notice: Array to string conversion
I think you forgot the quotes

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.