我有一个来自的对象数组 Sql group_concat()
while($row=$result->fetch_object( ))
{ echo $rows->PreviousV ;}
有逗号分隔的字符串,即xxxxxx,yyyyyy 我如何使用PHP循环它并将其内容显示为链接?
答案 0 :(得分:1)
试试explode。它将生成一个数组,然后您可以使用foreach列出它们。
例如:
$input = "hello,there";
foreach($input as $index=>$key)
{
echo $key;
}
输出:
hello
there