$result = [
['all_fields' => 'region=Омская область,city=омск'],
['all_fields' => 'region=Челябинская область,city=челябинск'],
];
$data = array_map(
fn($str) => array_reduce(
explode(',', $str),
function ($acc, $cur) {
[$key, $val] = explode('=', $cur);
$acc[$key] = $val;
return $acc;
},
[],
),
array_column($result, 'all_fields'),
);
print_r($data);
Array (
[0] => Array (
[region] => Омская область
[city] => омск
)
[1] => Array (
[region] => Челябинская область
[city] => челябинск
)
)
'PATH_INFO'По какому URL обращаетесь и что ожидаете увидеть в результате?
Contains any client-provided pathname information trailing the actual script filename but preceding the query string, if available. For instance, if the current script was accessed via the URI www.example.com/php/path_info.php/some/stuff?foo=bar, then $_SERVER['PATH_INFO'] would contain /some/stuff.
- $query = $db->query('INSERT INTO `order`(`user_id`, `articul_id`, `sharpener_id`, `barcode`, `quantity`) VALUES ('.$user_id.','.$articul_id.','.$sharpener_id.','.$barcode.','.$quantity.')');
+ $db->prepare(
+ 'INSERT INTO `order` (`user_id`, `articul_id`, `sharpener_id`, `barcode`, `quantity`)' .
+ 'VALUES (?, ?, ?, ?, ?)'
+ )->execute([$user_id, $articul_id, $sharpener_id, $barcode, $quantity]);
Prior to MySQL 8.0.4, MySQL used the Henry Spencer regular expression library to support regular expression operations, rather than International Components for Unicode (ICU).
...
The Spencer library supports word-beginning and word-end boundary markers ([[:<:]] and [[:>:]] notation). ICU does not. For ICU, you can use \b to match word boundaries; double the backslash because MySQL interprets it as the escape character within strings.
\\b111,222,333\\b