Regular expressions can also help clean up input text for more aesthetic purposes. Let's assume we want to convert a blog title into URL-friendly characters...
While regular expressions are often used for input validation, I also find them very useful for cleaning malicious code in user input. For this I used the function preg_replace. The idea is that I only allow certain characters through... |
POPULAR BLOG TAGS
orwell
bakery
php5tube
defcon
magazine
skateboard
security
color
email
encryption
science
cakephp
general
snowboard
mbta
debuggeddesigns
ableton
flash
routes
spam
mit
hobnox
release
trice
code
google
php
quicksilver
published
mailto
regular expressions
launch
1984
class
open source
boston
whoami
brain
rot13
as
charlie
geek
captcha
germans
sports
youtube
privacy
usort
drum machines
gmail
|