Здравствуйте, пытаюсь вывести список доменов через запятую с помощью
implode()
, но выводится ошибка:
Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in . . . Stack trace: #0
Код:
foreach ($arServer['domains'] as $arSite ):
print_r(implode (', ', $arSite['fqdn'])); //Домены
endforeach;
Массив:
[1] => Array
(
[id] => 6962448
[path] => testpoddomen/public_html
[domains] => Array
(
[0] => Array
(
[id] => 10346682
[fqdn] => poddomen.ru
[php_version] => 5.6
[http_version] => 1
[ssl] =>
[ssl_status] => none
[nginx_template] => default
[redis_session] =>
)
[1] => Array
(
[id] => 10346683
[fqdn] => su.poddomen.ru
[php_version] => 5.6
[http_version] => 1
[ssl] =>
[ssl_status] => none
[nginx_template] => default
[redis_session] =>
)
)
)
В чем может быть проблема?