R
R
Rasul Gitinov2016-01-17 19:37:39
PHP
Rasul Gitinov, 2016-01-17 19:37:39

How to display data from a mySQL table to a website?

In one of the tables, several parameters are stored in one cell in this form:

a:4:{i:0;b:0;s:18:"nav_menu_locations";a:0:{}s:17:"copyright_textbox";s:34:"Все права защищены";s:9:"logo_load";s:72:"http://cr65948-wordpress.tw1.ru/wp-content/uploads/2016/01/logo-mini.png";}

For example, I need to pull out a logo or copyright text from there. How exactly to do it?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
larry-troy, 2016-01-17
@raselgit

This is your serialized array, use the unserialize(String $str) function to deserialize and you will get an array back.

P
Pavel K, 2016-01-17
@PavelK

This is a JSON format, you can decode it like this: php.net/manual/ru/function.json-decode.php
But WordPress has native functions for working with its data, most likely you are doing something wrong. Take a look at the code.

M
Maqsat Batyrqul, 2016-01-17
@Maqsat

unserialize('a:4:{i:0;b:0;s:18:"nav_menu_locations";a:0:{}s:17:"copyright_textbox";s:34:"All rights reserved";s: 9:"logo_load";s:72:" cr65948-wordpress.tw1.ru/wp-content/uploads/2016/0... ";}');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question