我有一个页面,其中包含多个单选按钮,我使用foreach循环遍历所有单选按钮的名称,并在页面顶部使用另一个foreach循环获取所有单选按钮的名称作为键和值。
<?php
$radios=["name"=>"显示名称","profile"=>"显示配置文件","phone"=>"显示电话号码"];
$setting=[
"某些文字"=>"其值"]
foreach($radios as $key=>$value){
$setting[]=$value=>$_POST[$value];
}
// 它将无法工作
?> Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
不知道你想要实现什么,但是那段代码看起来不是有效的: