This is an example of a mixed tiered irregular array in php:
$settings['style_formats'] = array(
array('title' => 'Center table', 'selector' => 'table', 'styles' => array('margin-left' => 'auto', 'margin-right' => 'auto')),
array('title' => 'Menu style', 'selector' => 'ul,ol', 'classes' => 'menu'),
array('title' => 'Layer2', 'inline' => 'div', 'styles' => array('background-color' => 'orange')),
array('title' => 'Bold text', 'inline' => 'b'),
array('title' => 'Red text', 'inline' => 'span', 'styles' => array('color' => '#ff0000')),
array('title' => 'Red header', 'block' => 'h1', 'styles' => array('color' => '#ff0000')),
array('title' => 'Example 1', 'inline' => 'span', 'classes' => 'example1'),
array('title' => 'Example 2', 'inline' => 'span', 'classes' => 'example2'),
array('title' => 'Table styles'),
array('title' => 'Table row 1', 'selector' => 'tr', 'classes' => 'tablerow1'),
);
I need to find a method for representing and translating such an array from string format to php array. The format of the source string must be accessible for reading and writing by a person using a text editor. So, for example, this should not be the result of using "serialize", because "serialize" is a php function (and, rather, it is impossible for humans to create), and the string must be available for manual creation in a text editor.
The string will be passed as a parameter to a function that will translate it into a php array, such as above.
, - "". , "" , . preg_split , .
, ?