开发者

Echo part of a string

I have this string: computers,cars,movies,sports,etc...

$cars = explode(',', $cars)

How can i echo lets say 25 chars from 开发者_Go百科the string?


You can achieve it using the substr function:

echo substr($str, 0, 25);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜