Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Generowanie obrazka zamiast tekstu
podol
post
Post #1





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 12.07.2005
Skąd: Starogard Gdański

Ostrzeżenie: (0%)
-----


mam taki skrypt:

  1. <?
  2.  
  3. function getImageWithText($text, $font, $size)
  4. {
  5. $arr = imagettfbbox($size, o, $font, $text);
  6. $width = abs(arr[2] - $arr[0]) + 5;
  7. $height = abs($arr[1] - $arr[7]) + 1;
  8. $img = imagecreatetruecolor($width, $height);
  9. $white = imagecolorallocate($img, 255, 255, 255);
  10. $black = imagecolorallocate($img, 0, 0, 0);
  11.  
  12. imagefill($img, o, o, $white);
  13. imagegettftext($img, $size, 0, 0, $height - 5, $black, $font, $text);
  14.  
  15. return $img;
  16.  
  17. }
  18.  
  19. $img = getImageWithText("napis", "arial.ttf", 30);
  20. imagejpeg($img);
  21. imagedestroy($img);
  22.  
  23. ?>


Niestety pojawia się błąd:

Kod
Parse error: syntax error, unexpected '[' in C:\Program Files\WebServ\httpd\skrypt.php on line 6


Może ktoś mi pomoże

Ten post edytował podol 27.03.2006, 18:07:01
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 11:32