Building a script for email processing, and I am having problems limiting the number of characters given for a certain field. the function will take 2 arguments, the input, and some length. it returns the string to a maximum of "length" characters.
PHP Code:
function friendly($text, $length=1024) {
for($i=0; $i<$length; $i++) {
echo ____character____
}
}
I only want to print out 1 character at a time, until the limit is reached then it would end
so if i were to call
Code:
friendly("my name is josh", 5)
it would return "my na"
Bookmarks