Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] zmiana kodowania skryptu
---Tomek---
post
Post #1





Goście







  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
Go to the top of the page
+Quote Post
webdice
post
Post #2


Developer


Grupa: Moderatorzy
Postów: 3 045
Pomógł: 290
Dołączył: 20.01.2007




Użyj edytora który ma możliwość kodowania plików w UTF, chociażby notepad++.
Go to the top of the page
+Quote Post
robos85
post
Post #3





Grupa: Zarejestrowani
Postów: 466
Pomógł: 11
Dołączył: 21.09.2006
Skąd: Szczecin

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


polecam:
http://www.gzegzolka.com/
Go to the top of the page
+Quote Post

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: 18.09.2025 - 04:54