D
D
dNertyco2021-07-07 14:46:28
PHP
dNertyco, 2021-07-07 14:46:28

How to change array indexing?

I get data from the database using PDO PHP in this form:
60e591e0b2e06090685754.png
but this form does not suit me, since the task is: to sort through all key = value pairs, without knowing the names of the keys,
I need to get the data like this:

[
    ["name" => "name", "value" => "Иван"],
    ["name" => "surname", "value" => "Ургант"],
]

How to do it with PDO or json_encode or whatever?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question