Sam*_*ley -1 php arrays variables quotes
我使用以下代码输出数组
$values = array();
foreach ($album as $a){
$values[] = $a['value'];
}
$string = implode(' or ', $values);
}
Run Code Online (Sandbox Code Playgroud)
返回
1 or 2 or 3
Run Code Online (Sandbox Code Playgroud)
现在我怎么能把每个值都放到"",所以它看起来像
"1" or "2" or "3"
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助
if (!empty($values)) {
$string = '"' . implode('" or "', $values) . '"';
} else {
$string = 'What do you think you\'re doing!?';
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2555 次 |
最近记录: |