Fuction 1:
Is there a function that will help me count characters in a variable
Function 2:
Is there a function that will truncate the characters in the variable if there is more than 100 characters
I tested count_chars and ftruncate but got these error:
Warning: count_chars() [function.count-chars]: Unknown mode. in /home/kacieh/public_html/index.php on line 7
Warning: ftruncate(): supplied argument is not a valid stream resource in /home/kacieh/public_html/index.php on line 8
CODE
$var = "This is a really long string I want to see if I can truncate this string to being only 10 chars long, let's hope it works";
$size = 10;
echo count_chars($var, 10);
echo ftruncate($var, $size);
I don't know what that means
I really don't care why these didn't work unless somehow they will work and I am just doing something wrong, if they won't work, what will?