Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing ' , ( ) in a string with a space

Status
Not open for further replies.

lem72

Programmer
Jun 24, 2005
6
CA
Hey guys,

I think this is really simple and my brain is just not reacting right, but I am having trouble looking through a string for the characters ' , ( and ) and putting it into a db.

Here is what I have:

$vowels = array("/'/", "/,/", "/(/", "/)/");
$replacements = array("", "", "", "");
$results2 = preg_replace($vowels,$replacements,$results);
$sql = mysql_query("INSERT INTO urllist (webaddress, ourclient, depth) VALUES('$results2', '$client', '2')") or die (mysql_error());

and get the error: Warning: preg_replace(): Compilation failed: unmatched parentheses at offset 0 in script.php on line 40

I know i am being retarded but could someone tell me how I search and replace those symbols?

Cheers,
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top