S
S
spido2021-06-07 03:10:18
PHP
spido, 2021-06-07 03:10:18

How to parse a record from a database written as an array?

Greetings!
The data from the array is written to the database.
The result is an entry in the database: "back_color":"#ffffff" is the color. color_dunkle":"0" is the value of the radio button. If 1 - Show, if 0 - Don't show. In the frontend it is displayed on the html page in smarty using the $v.editable_page_theme_config variable:
{"back_color":"#ffffff","color_dunkle":"0"}

{foreach name="editable_page_list" item="v"}
    {$v.editable_page_theme_config}
{/foreach}


It is displayed in the same way as it is written in the database {"back_color":"#ffffff","color_dunkle":"0"}.
I need to parse an array entry into two variables and display them on the html page so that it looks something like this:
Color: #ffffff
Gradient: Don't show

Can you help me parse the array entry into two variables?
Thanks in advance for any help!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mletov, 2021-06-07
@spido

It's JSON, just google it "PHP JSON parse"

N
Nadim Zakirov, 2021-06-07
@zkrvndm

This data representation format is called JSON, most programming languages ​​out of the box can work with JSON. In the case of the php language, you need to use the json_decode () function

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question