Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> gdzie jest bład, Parse error: parse error in...
klekot
post
Post #1





Grupa: Zarejestrowani
Postów: 78
Pomógł: 0
Dołączył: 16.08.2005

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


Mam sobie taki kod
  1. <?php
  2. function pscode($string){
  3. //formatowanie
  4. $string = preg_replace("'(.*)'si","<b>1</b>", $string);
  5. $string = preg_replace("'(.*)'si","<i>1</i>", $string);
  6. $string = preg_replace("'(.*)'si","<u>1</u>", $string);
  7. $string = preg_replace("'
    (.*)
    'si"
    ,"<center>1</center>", $string);
  8. $string = preg_replace("'*)](.*)'si", "<font color="1">2</font>",$string);
  9. //obrazek 
  10. $string = preg_replace("'[img]([0-9a-zA-Z~`!@#$%^&-_=+|/:;]*)[/img]'si","<img src="1" border=0>", $string);
  11. //url'e
  12. $string = preg_replace("'([a-zA-Z0-9-_.]*)'si","<a href="http://1" target="_blank">1</a>", $string);
  13. $string = preg_replace("'([a-zA-Z]*://[a-zA-Z0-9._-]*)'si","<a href="1" target="_blank">1</a>", $string);
  14. $string = preg_replace("'([a-zA-Z._-]*[@]{1}[a-zA-Z0-9.-_]*){1}'si","<a href="mailto:1">1</a>", $string);
  15. $string = preg_replace("'*[@]{1}[a-zA-Z0-9.-_]*)]([a-zA-Z0-9.]*)'si", "<a href="mailto:1">2</a>", $string);
  16. $string = preg_replace("'*)]([a-zA-Z0-9.]*).'si", "<a href="http://1" target="_blank">2</a>", $string);
  17. $string = preg_replace("'*://[a-zA-Z0-9.]*)]([a-zA-Z0-9.]*)'si", "<a href="1" target="_blank">2</a>", $string);
  18.  
  19. //na wypadek, gdyby za wcześnie ucięło string'a
  20. $string = preg_replace("'[b](.*)'si","<b>1</b>", $string);
  21. $string = preg_replace("'[i](.*)'si","<i>1</i>", $string);
  22. $string = preg_replace("'[u](.*)'si","<u>1</u>", $string);
  23. $string = preg_replace("'[center](.*)'si","<center>1</center>", $string);
  24. $string = preg_replace("'[img]([0-9a-zA-Z~`!@#$%^&-_=+|/:;]*)'si","<img src="1" border=0>", $string);
  25. $string = preg_re");
  26. }place("'[color=([a-zA-Z1-9#(),]*)](.*)'si", "<font color="1">2</font>",$string);
  27. // To jest linia 173, tu jest pusto i nie ma tu zadnego kodu
  28.  
  29. return("$string");
  30. }
  31. ?>
i w miejscu icludowania pliku ktory czyta newsy (show.php), wyskakuje mi taki bład: Parse error: parse error in c:\usr\apache\httpd\html\n\a\functions.php on line 173
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: 20.08.2025 - 09:09