Posts: 1,832
Location: Somewhere else entirely
|
Quote:
|
Originally Posted by fambi
Thanks 0beron, it works.
But, for some reason, it is now spitting out:
�!��$%^&*()_+{}:@~?`-=[];�#<>,./
as the match!!! Any ideas why???
|
Not sure - might have something to do with the character set used to output the match? Try calling addslashes() or htmlentities() on the string before echoing it?
Tomos - this code uses a regular expression, which is basically a very compact and flexible way of finding specific things in text strings - here it is being used for picking out tags of some sort, but you can use them to check URLs and emails are valid, to match code numbers for an ordering system, to make sure usernames and form input don't have any dodgy characters or bits of script in them, the list goes on.
__________________
UPDATE 0beron SET talkupation = talkupation + lots WHERE post = 'helpful';
Please login or register to view this content. Registration is FREE (aka MSN handwriting for forums)
|