I am trying to extract substring from string gettting from mysql database using substr function:
substr($mystring,$startpoint,$endpoint);
here start and end point can be any number.
But I am not getting gesired result. Ptart point works but something is wrong with end point.
What is reason?
Edit
when I am pasin start ans end point like 15 and 50, start point is working fine so resultant string is starting from 15th char of main string . but end point is not working it’s giving me meand end char in resultant string is not 50th of main string.
You should subtract
$endpoint-$startpointand pass it as third parameter to get desired output.like below: