$url = 'https://example.com/files/file-название файла (1).docx';
$url = preg_replace_callback(
'/[а-яА-Я\s]+/ui',
static function ($matches) {
return rawurlencode($matches[0]);
},
$url
);
// https://example.com/files/file-%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%20%D1%84%D0%B0%D0%B9%D0%BB%D0%B0%20(1).docx
$hasReasonOne = (array_search('NUMBER 1', array_column($array["info"]["Reasons"], 'reason')) !== false);
foreach ($array["info"]["Reasons"] as $key) {
if ($key["reason"] == 'NUMBER 1') {
...
} elseif (!$hasReasonOne) {
// if reason one not exist
}
}