function _coder_replace_array_rearrange in Coder 7
Same name and namespace in other branches
- 7.2 scripts/coder_format/coder_format.inc \_coder_replace_array_rearrange()
Related topics
File
- scripts/coder_format/coder_format.inc, line 1376
- Coder format helper functions.
Code
function _coder_replace_array_rearrange($matches) {
preg_match_all('/(.+? => .+?,) /', $matches[3], $items);
$return = $matches[1] . $matches[2] . "\n";
foreach ($items[1] as $item) {
$return .= $matches[1] . ' ' . $item . "\n";
}
$return .= $matches[1] . ' ' . $matches[5] . ",\n";
$return .= $matches[1] . ')';
return $return;
}