超高層ビルのバナーの幅のサイズに応じて、3語を超える余裕がない長いフレーズを分割しようとしています。インターネットを検索して、フレーズの文字を長く設定することでテキストを分割するスクリプトを見つけました。これがこれです。
<?
header("Content-type: image/png");
$string = $_GET['text']. ' Click Here';
$im = imagecreatefrompng("../../images/skyscrapper.png");
$orange = imagecolorallocate($im, 0, 0, 0);
$px = (imagesx($im) - 3.8 * strlen($string)) / 2;
$font = 'verdana.ttf';
// Break it up into pieces 10 characters long
$lines = explode('|', wordwrap($string, 10, '|'));
// Starting Y position
$y = 450;
// Loop through the lines and place them on the image
foreach ($lines as $line)
{
imagestring($im,3, $px, $y, $string, $orange);
// Increment Y so the next line is below the previous line
$y += 23;
}
imagepng($im);
imagedestroy($im);
?>
問題は、このスクリーンショットのようにテキストを壊す代わりに、出力がフレーズを3回複製する
ことです。誰かが問題の内容と、どうすればよいかを説明するのを手伝ってもらえますか?