Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php] linkowanie linkow
AndyPSV
post
Post #1





Grupa: Zarejestrowani
Postów: 393
Pomógł: 5
Dołączył: 6.02.2003
Skąd: The.Luciferian.Doctrine.p
df

Ostrzeżenie: (30%)
XX---


  1. function link($s) {
  2. $p1 = '{(http://[a-z.][^\n\s]*)}';
  3. $pp1 = '<a href="$1">$1</a>';
  4. $s = preg_replace($p1,$pp1,$s);
  5.  
  6. return $s;
  7. }



moglby ktos naprawic ten skrypt albo wkleic swoj co podmienia linki?

zrobilem: http://path-of-power.com/php-replace-link-function,203
wordwrap mialem i nie dzialalo

  1. <?php
  2.  
  3. function rplc($x,$style='') {
  4. $x = ereg_replace('[-a-z0-9!#$%&\'*+/=?^_`{|}~]+@([.]?[a-zA-Z0-9_/-])*','<a href=\'mailto:\\0\' '.$style.'>\\0</a>',$x);
  5. $x = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a target='_blank' href='\\0'>\\0</a>",$x);
  6. return $x;
  7. }
  8.  
  9. ?>
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: 22.08.2025 - 02:00