Thread: My Code?
View Single Post
Old 10-22-2007, 11:32 PM   #4 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

A couple of things to mention. Concerning your regular expression for checking the domains, I don't think such domains as .co.uk and .org.uk domains will validate. Also the hyphen character (-) is technically a regular expression character for range and therefore should be escaped. Although it would work fine in the instances you've used to it in.

Also, one more thing, just for making your code nice and tidy if you're particular - which it would appear you are, use the single quotes (see this article) when outputting the HTML, or the heredoc concept (which I personally dislike) makes it much neater:

Single Quotes (Yum!)

PHP Code:
echo 'Show this';
echo 
'And this';
echo 
'And this, too!'
Heredoc (Yuk!)

PHP Code:
<<<EOF
Show this
And this
And this, too!
EOF; 
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote