PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Im trying to create a function to limit the characters within a string, then keep going untill it finds the first space in the string and echo the results.
You set the value of $value a hell of a lot of times.
What you're attempting to return is multiple characters in a string of only one.
Maybe, to simplify, have your function take the string as a parameter.. maybe $sString, then traverse THAT string using $value = substr($sString, $limit, 1).
Return substr($sString, 0, $limit), and it should work.