$GLOBALS['arrFilter'] = ['PROPERTY_CITY_INFO' => $_POST['id']];
$GLOBALS['arrFilter'] = ['=PROPERTY_CITY_INFO.NAME' => 'Москва'];
Array (
[data] => Array (
[ActionsResult] => Array ( )
[Accounts] => Array (
[0] => Array (
[Login] => pl4tpass
[Discount] => 0
[Currency] => RUB
[AmountAvailableForTransfer] => 0
[SmsNotification] => Array (
[MoneyOutSms] => No
[PausedByDayBudgetSms] => Yes
[SmsTimeTo] => 21:00
[MoneyInSms] => No
[SmsTimeFrom] => 09:00
)
[Amount] => 0
[AgencyName] =>
[EmailNotification] => Array (
[SendWarn] =>
[MoneyWarningValue] => 20
[PausedByDayBudget] => Yes
[Email] => pl4tpass@yandex.ru
)
[AccountID] => 49797112
)
)
)
)
$tov = mysql_query("SELECT product_id FROM oc_product_to_category WHERE category_id = $cat_id", $link);
while ($result = mysql_fetch_array($tov)) {
$productId[] = $result['product_id'];
}
$searchIn = implode(',', $productId);
$sel = mysql_query("SELECT `seller_id` FROM `oc_ms_product` WHERE product_id IN ($searchIn)" , $link);
while ($resul = mysql_fetch_array($sel)) {
echo $resul['seller_id'] . '<br>';
}
$string = '<div class="remove_div" id="first" style="">
<div class="remove_div bg-info">
<div class="remove_div" style="">
/* тут вложения всякие из HTML кода и прочее которое нужно оставить */
</div>
</div>
</div>';
$string = preg_replace('/<div[^>]+class=".*remove_div.*"[^>]*>(.*)/', '', $string);
print_r($string);
$string = 'id=171:znac=1;id=203:znac=1;id=225:znac=1;id=162:znac=0.5;id=203:znac=31;';
preg_match_all('/id=(\d+)/', $string, $matches);
var_dump($matches[1]);
$data = [
341 => [
'name_rm' => 'Мастер',
'type_id' => 4,
'contract_id' => 6,
'equipment' => 'CyberPower BE700ELCD',
'serial_number' => '1GS7W3002242'
],
342 => [
'name_rm' => 'Мастер',
'type_id' => 4,
'contract_id' => 6,
'equipment' => 'CyberPower BE700ELCD',
'serial_number' => '1GS7W3002242'
],
343 => [
'name_rm' => 'Мастер',
'type_id' => 4,
'contract_id' => 6,
'equipment' => 'CyberPower BE700ELCD',
'serial_number' => '1GS7W3002242'
]
];
$array = array_column($data, 'contract_id');
$array = array_unique($array);
if(count($array) > 1) {
echo 'Ошибка';
}
elseif($array[0]) {
echo $array[0];
}
public function buildTree($data) {
$childs = array();
foreach($data as &$item) {
$childs[$item['parent_id']][] = &$item;
unset($item);
}
foreach($data as &$item) {
if (isset($childs[$item['id']])) {
$item['childs'] = $childs[$item['id']];
}
}
return $childs[0];
}