Some of the code found on the web is pieced together. But the final step does not show the total is not their own text content, the code is as follows:
$v) {$w = Charwidth ($fontsize, $fontangle, $ttfpath, $v); $_width + = Intval ($w); if (($_width > $width) && ($v!== "")) {$_string. = "\ n"; $_width = 0; } $_string. = $v; $w = 0; Echo $v; } $_string = Mb_convert_encoding ($_string, "html-entities", "GBK"); return $_string; } $str = AutoWrap (12,0, ' 33.ttf ', ' returns an array of characters ', 250); Imagettftext ($im, $font _size,0,35,160, $black, $fontname, $STR); Header (' Content-type:image/jpeg '); Imagejpeg ($im); Imagedestroy ($im); }?>
How do you change the words that return an array of characters to a parameter that STR passes over? Thank you, great God.
Reply to discussion (solution)
Can you put your last word "how do I change the number of words that return an array of characters to a parameter that str passes over?" "Write an example to post it, and the last step of the code above you is referring to this?" Imagettftext ($im, $font _size,0,35,160, $black, $fontname, $STR);
Can you put your last word "how do I change the number of words that return an array of characters to a parameter that str passes over?" "Write an example to post it, and the last step of the code above you is referring to this?" Imagettftext ($im, $font _size,0,35,160, $black, $fontname, $STR);
I want to replace the "return an array of characters" with the function that I passed.
is the ability to implement text wrap ... Because it is small white can only copy a piece of code to modify
Himself put: $str = AutoWrap (12,0, ' 33.ttf ', ' returns an array of characters ', 250); This paragraph is changed to $str = AutoWrap (12,0, ' 33.ttf ', ' $_get[' str '] ', 250);
After such a direct cannot receive, do not know is the question of grammar or what problem, remove the quotation marks and become empty ... Do not know where the problem is, so to solve
The simple point is:? str=, how are you, hello, how you doin ', How you doin ', How you doin '? After the 78th word, the watermark is automatically wrapped in the picture
I changed it, defined a new function has been done, thank you