Каждая строка должна быть отделена символом CRLF (\r\n). Строки не должны быть длиннее 70 символов.
$out_users = [];
foreach($array_decode['response'] as $user)
$out_users[$user['id']]['user'] = $user['user'];
$out_users = [];
foreach($array_decode['response'] as &$user) // обратите внимание на доступ по ссылке & к элементу массива
{
$out_users[$user['id']]['user'] = $user['user'];
unset($user); //удаляем элемент из массива $array_decode['response'], чтобы не росло использование памяти.
}
update your_table set name = replace(name, '_', '-')
header('Content-Type: text/html; charset=utf8', true);
<?foreach ($arResult["PARTNERS"] as $partners) {if($partners['NAME']=='test')continue;?>
SELECT p.*,
case
when exists(SELECT 1 from cart c where c.products_id = p.id)
then 1
else 0
end is_exists_in_cart -- есть товар к корзине? 0 - нет, 1 - есть
FROM table_products p
SELECT p.*, c.*
FROM table_products p
left join cart c on c.products_id = p.id
insert into your_table (your_field)
values ( STR_TO_DATE(?, '%d.%m.%Y %h:%i') )
$sth = $dbh->prepare("insert into your_table (your_field)
values ( STR_TO_DATE(:your_datetime_string, '%d.%m.%Y %h:%i') )");
$sth->bindParam(':your_datetime_string', $date_time.' '.$time, PDO::PARAM_STR);
$sth->execute();
$recaptcha_property_name = 'error-codes';
echo $recaptcha->$recaptcha_property_name[0];
select distinct g.*
from goods g
join category c on c.id = g.category_id
and c.parent_id = 34
select distinct g.*
from goods g
join good_category_hold gch on g.id = gch.good_id
join category c on c.id = gch.category_id
and c.parent_id = 34
foreach ($model as $massiv)
{
echo $massiv[1] . "<br>";
}
foreach ($model as $massiv)
{
$massiv_new = array_values($massiv);
echo $massiv_new [1] . "<br>";
}
return $current($context, function ($context) use ($this, $next) {
return $this($context, $next);