Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [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
 
Start new topic
Odpowiedzi
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

Posty w temacie
- --Tomek--   [PHP] zmiana kodowania skryptu   16.10.2008, 19:50:04
- - webdice   Użyj edytora który ma możliwość kodowania plików w...   16.10.2008, 20:00:28
- - robos85   polecam: http://www.gzegzolka.com/   17.10.2008, 08:33:02


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: 16.10.2025 - 17:34