View Single Post
Old 10-19-2007, 10:33 PM   #5 (permalink)
Andrew
The Acquainted
 
Join Date: Sep 2007
Location: Arizona
Posts: 114
Thanks: 10
Andrew is on a distinguished road
Default

But how can I use preg_match() to clear out all the unwanted characters using regular expressions? For example, if I used:
PHP Code:
<?php
$string 
"!@#$abc";
echo 
preg_match("/^abc/"$string);
?>
That will output "abc", but what happens if I have for example "a!@#b!@#c", and try to use that same pattern? It wouldn't show any matches. So how could I do it using just preg_match?
Send a message via AIM to Andrew Send a message via MSN to Andrew
Andrew is offline  
Reply With Quote