Organizational Research By

Surprising Reserch Topic

Question: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 the string?

asked Sep 13, 2013 in PHP by anonymous
edited Sep 12, 2013
0 votes
20 views



Related Hot Questions

2 Answers

0 votes

 

If the string like this
 
     computers,cars,movies,sports
 
thn the ans is
$cars="computers,cars,movies,sports";
$cars = explode(',', $cars,0);
echo substr($cars[0],0,24);
?>
answered Sep 13, 2013 by anonymous
reshown Sep 12, 2013 by rajesh
0 votes

 

If the string like this
 
     computers,cars,movies,sports
 
thn the ans is
$cars="computers,cars,movies,sports";
$cars = explode(',', $cars,0);
echo substr($cars[0],0,24);
?>
answered Sep 13, 2013 by anonymous
reshown Sep 12, 2013 by rajesh

...