0
Array ([0] => LOWER CERVICAL)
Array ([0] => LOWER CERVICAL [1] => Degenerative)
Array ([0] => LOWER CERVICAL [1] => Degenerative [2] => Degenerative)
Array ([0] => LOWER CERVICAL [1] => Degenerative [2] => Degenerative [3] => Cervical myelopathy(Spondylotic))
我使用数组来保存结果,但我不知道如何将上述数组格式转换为下面的字符串格式。我作为预期输出给将多维数组转换为字符串在PHP中
Expeceted输出到上述阵列格式转换为字符串:
LOWER CERVICAL>>Degenerative>>Degenerative>>Cervical myelopathy(Spondylotic)>>
代码:
while($rsdiag=mysql_fetch_array($sqldiag))
{
$items[$i] = $rsdiag['di_name'];
echo $rsdiag['di_name'].">>";
print_r($items);
$i++;
}
你什么到目前为止尝试过?发布您的尝试 –
这是1阵列还是打印在一个循环? – Rizier123
'echo implode(“>>”,$ items)。 “>>”;' – Rizier123