V
V
Viktor Paperno2015-11-30 23:06:54
PHP
Viktor Paperno, 2015-11-30 23:06:54

How to convert from string to array in php?

A question.
As a result of the SQL query, I get a line like this:

[{"id":"1","value":""},{"id":"2","value":""},{"id":"3","value":""},{"id":"4","value":""}]

How can I get an array from this? I need to get the values ​​of the value field at the end for a specific id
value Thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander N++, 2015-11-30
@AviPaperno

By the way, starting with mysql 5.7, you can search the JSON database and work with JSON data at the DB level
https://www.percona.com/live/mysql-conference-2015...
PS sphinx 2.1+ can index JSON
Well, the answer has already been suggested to you how to work with json
Therefore, I think storing JSON in the database is a normal topic only in BLOB fields

I
Ivanq, 2015-11-30
@Ivanq

json_decode read

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question