הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

 
 
כלים לאשכול תצורת הצגה
Prev הודעה קודמת   הודעה הבאה Next
ישן 30-03-08, 14:05   # 1
Labs
חבר וותיק
 
מיני פרופיל
תאריך הצטרפות: Nov 2007
גיל: 34
הודעות: 1,500
Send a message via Skype™ to Labs

Labs לא מחובר  

php | gd | strings

בניתי תמונה
שמגרילה משפט
וכותבת אותו על תמונה (חתימה)

אז בכדי לשים משפטים ארוכים יותר בניתי משהו שיחתוך לי מחרוזת אבל לא באמצע מילה וידפיס אותה מתחת וכמו שאולי הבנתם כבר זה לא עובד לי
התוכנית במלואה:
PHP קוד:
<?php 
header
("Content-type: image/png");
$img imagecreate(470,70);
$Hcolor imagecolorallocate($img247247247); 
$bcolor imagecolorallocate($img000); 
$tfont "david.ttf";
imagerectangle($img0047070$Hcolor);
$input = array(
"Guns don't kill people. Chuck Norris kills People."
"There is no theory of evolution. Just a list of animals Chuck Norris allows to live. ",
 
"Chuck Norris does not sleep. He waits.",
 
"The chief export of Chuck Norris is Pain. ",
 
"There is no chin under Chuck Norris' Beard. There is only another fist. ",
 
"Chuck Norris has two speeds. Walk, and Kill. ",
 
"The leading causes of death in the United States are: 1. Heart Disease 2. Chuck Norris 3. Cancer.",
 
"Chuck Norris drives an ice cream truck covered in human skulls.",
 
"When the Boogeyman goes to sleep every night, he checks his closet for Chuck Norris.",
 
"Outer space exists because it's afraid to be on the same planet with Chuck Norris.",
 
"Chuck Norris is suing Myspace for taking the name of what he calls everything around you."
);
$kearray_rand($input1);
$stf=$input[$ke];
$slen=strlen($stf);
if (
$slen<70) {
    
imagettftext $img120215$bcolor$tfont$stf );
} else {
// ראו חלק זה VVV
    
$words explode(" "$stf);
    
$numw=count($words); // מספר מילים
    
$b=0;
    for (
$i=0;$i<=$numw;$i++) {
        
$len=0;
        while (
$len<70) {
            
$arr[$b]=$arr[$b].$words[$i]." ";
            
$len=strlen($arr[$b]);
            
$i++;
        }
        
$b++;
    }
// problem here ^^^^
    
for ($i=1;$i<=$b;$i++) {
        
$hi=15*$i;
        
$ia=$i-1;
        
$te=$arr[$ia];
        
imagettftext $img1202$hi$bcolor$tfont$te );
    }
}
imagepng($img); 
imagedestroy($img);
?>
אנא עזרו לי לפני שאני נשאר ללא שיערות
__________________
אין יותר צהל!
Skype: lab5dan
  Reply With Quote
 

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 00:10.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ