<?php
$orig = [
[
0 => 'Введите vin-код',
4 => 'Идентификационный номер',
5 => 'XTA2*******************',
6 => 'Марка',
7 => 'LADA',
8 => 'Модель',
9 => '21901',
10 => 'Тип транспортного средства',
11 => 'легковой автомобиль',
12 => 'Объем двигателя, куб.см.',
13 => '1100-1800',
14 => 'Модельный год',
15 => '1985',
16 => 'Рынок сбыта',
17 => 'внутренний рынок',
18 => 'Страна происхождения',
19 => 'Россия',
20 => 'Серийный номер',
21 => '325847',
]
];
$need = [
'brand' => 'Марка',
'model' => 'Модель'
];
$result = [];
foreach ($orig as $arr) {
$record = [];
foreach ($need as $keyNew => $keyOld) {
if (in_array($keyOld, $arr)) {
$index = array_search($keyOld, $arr);
$record[$keyNew] = $arr[intval($index)+1];
}
}
if (!empty($record)) {
$result[] = $record;
}
}
var_dump($result);
$var = '5+3='.(5+3).'!'
$sql = 'SELECT * FROM users WHERE id IN ('.implode(',' , [1,2,3,4,5]).')'
$while1 = [
[
"id" => '1',
"amount" => '11',
],
[
"id" => '2',
"amount" => '12',
],
];
foreach ($while1 as $subArray) {
foreach ($subArray as $key=>$value) {
if ($key == 'amount') {
echo $value."\n";
}
}
}
// OR
foreach ($while1 as $subArray) {
echo $subArray['amount']."\n";
}
<Directory /home/alx/www/remload>
AllowOverride All
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>
<VirtualHost *:80>
ServerName localhost
ServerAdmin webmaster@localhost
DocumentRoot /home/alx/www
<Directory /home/alx/www>
AllowOverride All
Options Indexes FollowSymLinks MultiViews
Require all granted
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel debug
CustomLog /var/log/apache2/access.log combined
</VirtualHost>