【发布时间】:2020-09-14 02:52:24
【问题描述】:
您好,我的 PHP 中有以下变量:
$art= [
'places' => ['America','Paris','Italy','Japan'],
'photographer' => ['Samantha','Hannah','David','Albert'],
];
我只是想将“地点”仅输出到我的 HTML 代码中。不断收到“非法字符串偏移”警告。
为什么我的以下代码不起作用?
<?php foreach($art as $value): ?>
<?= $value['places'] ?>
<?php endforeach ?>
【问题讨论】: