我有一个字符串数组,这些字符串中有空格。例如:
$arr = array('bob', 'john smith', 'grease monkey', 'etc');
为什么当我尝试时$str = implode('|', $arr);
,它会停在它找到的第一个空间?我留下了一个像这样的字符串:
$str = "bob|john";
如果我尝试:
$arr = array('bob', 'john', 'grease monkey', 'etc');
并内爆,我得到:
$str = "bob|john|grease";
编辑:我实际上是在尝试将其设置为隐藏字段的值:
<input id="hidLblFields" name="hidLblFields" type="text" value=<?php echo implode('|', $myFields);?> />