$str = \'HelloWorld\'; $sub = substr($str, 3, 5); echo $sub; // prints \"loWor\"
I know that substr() takes the first parameter, 2nd parameter is start
It's just math
$sub = substr($str, 3, 5 - 3);
The length is the end minus the start.