我有一些数据存储在单列 mysql DB 中,如下所示:
1-Yizle-smallpic-this is pretty cool-2-User-smallpic-testing!1-Yizle-smallpic-this is pretty cool-2-User-smallpic-testing!-
现在我想在 for 循环中输出该数据,并需要它每 4 个连字符循环一次,因为数据输出将是
$uid,$username,$userpicurl,$comment..
到目前为止,我的代码显然有效,但只返回第一次出现。
foreach($result->fetch_assoc() as $v){
list($uid, $username, $userpicurl, $comment) = explode("-", $v); print "$uid $username $userpicurl $comment";
}