用逗号分隔 [英] separate with commas

查看:92
本文介绍了用逗号分隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我有这个,

$following_user_id .= $row['following_user_id'];

我得到

44443344330

那么我使用implode p>

then I use the implode() function and seperate with commans

44,44,33,44,33,0, 

但我不想要最后一个数字的最后一个逗号?

but I don't want the last comma on the last number?

这可能吗?

推荐答案

检查implode: http://php.net/manual/en/function.implode.php

Check implode: http://php.net/manual/en/function.implode.php

代码示例:我假设你使用某种循环?

Code example: I'm assuming your using some sort of loop?

$arrUsers = new array();

... your loop code here ...
array_push($arrUsers, $row['following_user_id']);
... end loop code .. 
$following_user_id = impload(",", $arrUsers); 

这篇关于用逗号分隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆