Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] Losowe zdjecie, pomoc
--nuker44--
post
Post #1





Goście







Witam, potrzebuje zedytować ten kod by wyswietlał losoowo element img_empty.jpg, img_empty2.jpg etc. Mogłbym prosić kogos o pomoc?

  1. <?php
  2. $textwidth = abs($box[4] - $box[0]);
  3. $x_finalpos = 255-($textwidth/2);
  4. $image = imagecreatefromjpeg('img_empty.jpg');
  5. $font_color = ImageColorAllocate($image,0,0,0);
  6. ImageJPEG($image, $img);
  7. ImageDestroy($image);
  8. ?>
Go to the top of the page
+Quote Post
CuteOne
post
Post #2





Grupa: Zarejestrowani
Postów: 2 958
Pomógł: 574
Dołączył: 23.09.2008
Skąd: wiesz, że tu jestem?

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


google -> php rand()
google -> php array()

a na koniec
  1. $image = imagecreatefromjpeg($imagesArray[$rand]);
Go to the top of the page
+Quote Post
--nuker44--
post
Post #3





Goście







jestem zielony w php, moglby mi ktos pomoc z tym?
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 23.08.2025 - 08:26