T
T
Taras Labiak2014-10-04 11:59:08
Drupal
Taras Labiak, 2014-10-04 11:59:08

What is the JSON-like data format used by Drupal?

What data format is used in Drupal

SELECT cast(`value` as char) FROM drupal.variable
WHERE `name`='language_negotiation_language_url'

added hyphens for readability
a:2:{s:10:"locale-url";a:2:{s:9:"callbacks";
a:3:{s:8:"language";
s:24:"locale_language_from_url";
s:8:"switcher";
s:28:"locale_language_switcher_url";
s:11:"url_rewrite";
s:31:"locale_language_url_rewrite_url";}s:4:"file";
s:19:"includes/locale.inc";}s:19:"locale-url-fallback";
a:2:{s:9:"callbacks";a:1:{s:8:"language";s:28:"locale_language_url_fallback";}
s:4:"file";s:19:"includes/locale.inc";}}

I don't think it would be a problem to parse it yourself, but still, what function would it be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kolotilin, 2014-10-04
@kissarat

This is serialization.
The serialize() function returns a string representation of any value that can be stored in PHP. The unserialize() function uses this line to restore the original value of the variable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question