36 lines
898 B
PHP
36 lines
898 B
PHP
<?php
|
|
/**
|
|
* Since 2013 Ovidiu Cimpean.
|
|
*
|
|
* Ovidiu Cimpean - Newsletter Pro © All rights reserved.
|
|
*
|
|
* DISCLAIMER
|
|
*
|
|
* Do not edit, modify or copy this file.
|
|
* If you wish to customize it, contact us at addons4prestashop@gmail.com.
|
|
*
|
|
* @author Ovidiu Cimpean <addons4prestashop@gmail.com>
|
|
* @copyright Since 2013 Ovidiu Cimpean
|
|
* @license Do not edit, modify or copy this file
|
|
*
|
|
* @version Release: 4
|
|
*/
|
|
|
|
class NewsletterProDot
|
|
{
|
|
public static function create(array $array)
|
|
{
|
|
$ritit = new RecursiveIteratorIterator(new RecursiveArrayIterator($array));
|
|
$result = [];
|
|
foreach ($ritit as $leafValue) {
|
|
$keys = [];
|
|
foreach (range(0, $ritit->getDepth()) as $depth) {
|
|
$keys[] = $ritit->getSubIterator($depth)->key();
|
|
}
|
|
$result[join('.', $keys)] = $leafValue;
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
}
|