×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

PHP example - How to automatically detect the links in a text with PHP regular expression?


PHP - How to automatically detect the links in a text with PHP regular expression?

<? 
    
   $strText = 'this is a test http://www.netartmedia.net asda'; 

   $strText = preg_replace( '/(http|ftp)+(s)?:(//)((w|.)+)(/)?(S+)?/i', '<a href="">4</a>', $strText ); 
    
   echo $strText; 
    
   ?>

Category: PHP

 
<< Go back