Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP] zmiana kodowania skryptu
Forum PHP.pl > Forum > Przedszkole
--Tomek--
  1. <?php
  2.  
  3. /********************************************
  4. A very simple little piece of PHP to include a random bit of text/html into any php page.
  5.  
  6. Just edit the default value and the array, then add an include statement to a php like;
  7.  
  8. include "randomb.php";
  9.  
  10. where you want the random bit to be within the page.
  11.  
  12. Note the array can be expanded/decreased to have as many values as you want
  13.  
  14. If you like or find this little piece of PHP of value just let someone know about
  15. pWidgets or add a link on your site to ours.
  16. pWidgets - <a href=\"http://www.pwidgets.com\" target=\"_blank\">http://www.pwidgets.com</a>
  17.  
  18. Thank you!
  19. **********************************************/
  20.  
  21. $default = "If you like or find this little piece of PHP of value just let someone know about pWidgets or add a link on your site to ours. pWidgets - <a href=\"http://www.pwidgets.com";&#092;" target=\"_blank\">http://www.pwidgets.com";</a>
  22.  
  23.    $randomb = array("Random Value 1 If you like or find this little piece of PHP of value just let someone know about pWidgets or add a link on your site to ours. pWidgets - <a href=\"http://www.pwidgets.com"&#092;" target=\"_blank\">http://www.pwidgets.com"</a>,
  24.             "Random Value 11±±±± add random bit to your site");
  25.    $total_randomb = sizeof($randomb);
  26.    $randomb_num = rand(0,$total_randomb);
  27.    
  28.  
  29. $randombtext = $randomb[$randomb_num];
  30.  
  31. if ($randombtext == "") {
  32.  
  33.   $randombtext2 = $default;
  34.  
  35. }
  36. else {
  37.  
  38.   $randombtext2 = "$randombtext";
  39.  
  40. }
  41.    echo "$randombtext2";
  42.  
  43. ?>

jak zmienic kodowanie skryptu na UTF-8
webdice
Użyj edytora który ma możliwo¶ć kodowania plików w UTF, chociażby notepad++.
robos85
polecam:
http://www.gzegzolka.com/
To jest wersja lo-fi głównej zawarto¶ci. Aby zobaczyć pełn± wersję z większ± zawarto¶ci±, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.