- var_export: documentation ( source)
- array_walk: documentation ( source)
<?php
$arr = [
'4X2' => 86,
'4X3' => 9,
'4X4' => 5,
'6X2' => 14,
'6X4' => 1
];
array_walk(
$arr,
fn(&$v, $k) =>
$v = [
'title' => $k,
'search' => "&vconfiguration[]=$k",
'count' => $v
]
);
var_export($arr);