Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
$tmp = explode( ", ", ", , , , , , , , , "); $arResult = []; foreach($tmp as $k..
Decoded Output download
<? $tmp = explode( ", ", ", , , , , , , , , ");
$arResult = [];
foreach($tmp as $key => $value){
$arResult["ITEMS"][$key] = ["NAME" => $value];
}
$arResult['templateGrid'] = explode(',','2,1,2,1,1,1,2,1,1,2');
$arClassMapNew = [
1 => [
'big-grid__item-one-center-new'
],
2 => [
'big-grid__item-two-center-left-new',
'big-grid__item-two-center-right-new',
],
3 => [
'big-grid__item-three-left',
'big-grid__item-three-center',
'big-grid__item-three-right',
],
4 => [
'big-grid__item-four-one',
'big-grid__item-four-two',
'big-grid__item-four-three',
'big-grid__item-four-four',
]
];
$itemPosition = 0;
foreach ($arResult['templateGrid'] as $keyGrid => $itemGrid)
{
if(!isset($arResult['ITEMS'][$itemPosition]))
{
continue;
}
for($i = 0; $i < $itemGrid; ++$i)
{
$gridsClass = $arClassMapNew[$itemGrid];
$arResult['ITEMS'][$itemPosition]['NAME_CLASS'] = $gridsClass[$i];
++$itemPosition;
}
}
echo '<pre>';
print_r($arResult);
echo '</pre>';
die(); ?>
Did this file decode correctly?
Original Code
$tmp = explode( ", ", ", , , , , , , , , ");
$arResult = [];
foreach($tmp as $key => $value){
$arResult["ITEMS"][$key] = ["NAME" => $value];
}
$arResult['templateGrid'] = explode(',','2,1,2,1,1,1,2,1,1,2');
$arClassMapNew = [
1 => [
'big-grid__item-one-center-new'
],
2 => [
'big-grid__item-two-center-left-new',
'big-grid__item-two-center-right-new',
],
3 => [
'big-grid__item-three-left',
'big-grid__item-three-center',
'big-grid__item-three-right',
],
4 => [
'big-grid__item-four-one',
'big-grid__item-four-two',
'big-grid__item-four-three',
'big-grid__item-four-four',
]
];
$itemPosition = 0;
foreach ($arResult['templateGrid'] as $keyGrid => $itemGrid)
{
if(!isset($arResult['ITEMS'][$itemPosition]))
{
continue;
}
for($i = 0; $i < $itemGrid; ++$i)
{
$gridsClass = $arClassMapNew[$itemGrid];
$arResult['ITEMS'][$itemPosition]['NAME_CLASS'] = $gridsClass[$i];
++$itemPosition;
}
}
echo '<pre>';
print_r($arResult);
echo '</pre>';
die();
Function Calls
None |
Stats
MD5 | 8741590d32e5cdcd7e7e6ae8c9bb7e67 |
Eval Count | 0 |
Decode Time | 57 ms |