Page 1 of 1

Convert links to lowercase

Posted: Fri Jul 06, 2007 3:30 am
by superdez
The following script to change all links to lowercase is incorrect: Why??? The scripts selects the links correctly but then replace them with this: href="\L\E"



Change this:

href="All-Links-On-My-Site.html"

To this:

href="all-links-on-my-site.html"


Find:

[ \t\r\n]*href[ \t\r\n]*=[ \t\r\n]*"(.*)html"

Replace:

href="\L\1\E"

Posted: Fri Jul 06, 2007 8:10 am
by feyd
There's no regular expression in PHP that alters case. Use preg_replace_callback().