- print_r: documentation ( source)
- explode: documentation ( source)
<?php
$res = '';
$attributes = explode("||", 'черный==0||зеленый==0||салатовый==0||полированный==0||оранжевый==0||красный==0||белый==0');
foreach ($attributes as $value_attribute) {
if (!empty($value_attribute)) {
/* $fields = array(
'parameter_id' => $liid,
'attribute' => $value_attribute
); */
//$modx->db->insert($fields, $mod_table[2]);
//$res .= $value_attribute.'<br>';
$attributes_delimiter .= $value_attribute;
} else {
}
}
$vad = explode("==", $attributes_delimiter);
foreach ($vad as $value_attribute_delimiter) {
$res .= $value_attribute_delimiter;
}
echo '<pre>';
print_r($vad);
echo '</pre>';
echo $res;