Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting URLS: Win98 anomaly?

Status
Not open for further replies.

AndyatIES

Technical User
Jul 4, 2002
18
GB
I'm using this code to convert urls:

// Find e-mail addresses and add a mailto <a href> tag.
$str = preg_replace(&quot;/(\w|\-|\.)+@(\w|\-)+(\.|(\w|\-)+)+/&quot;, &quot;<a href=\&quot;mailto:$0\&quot;>$0</a>&quot;, $str);

// Find URLs (starting with http or https) and add a <a href> tag.
$str = preg_replace(&quot;/http?\:\/\/\S+/&quot;, &quot;<a href=\&quot;$0\&quot;>$0</a>&quot;, $str);

Works fine on my Win95 and Unix (ISP hosted) Apache servers, but on a separate Win98 Apache setup, all I get is:

<a href=&quot;$0&quot;>$0</a>

Using the same versions of PHP, MySQL and Apache on all three locations. Have checked my PHP.ini line by line, and can see nothing to cause this failure. Any ideas?
 
Many thanks, that sorts it. Can you tell me why? I've seen this URL conversion twice now, both times using the $(num) configuration. I'm still a PHP beginner, so I wouldn't have thought of using // from what I've read.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top