开发者

Echo part of a string

开发者 https://www.devze.com 2023-01-24 20:44 出处:网络
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:

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

精彩评论

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

关注公众号