如何显示对象数组的内容

时间:2014-07-21 09:56:41

标签: php

我有一个来自的对象数组  Sql group_concat()

while($row=$result->fetch_object(  ))
  { echo  $rows->PreviousV ;}

有逗号分隔的字符串,即xxxxxx,yyyyyy 我如何使用PHP循环它并将其内容显示为链接?

1 个答案:

答案 0 :(得分:1)

试试explode。它将生成一个数组,然后您可以使用foreach列出它们。

例如:

$input = "hello,there";
foreach($input as $index=>$key)
{
  echo $key;
}

输出:

hello
there