Hello, I am using this simple preg_replace function to turn "Google" into a linkt o the Google site (not really what I am using it for I am just using it as an example) [code] $txt = preg_replace( "#Google#is", "<a href='http://www.google.com/'>Google</a>", $txt ); [/code] But what about if I want to link Yahoo, well the simple option would be to just repeat the line. However, what if I start adding in MSN, Alta Vista, it will all get very confusing, so I create an array. The array setting the words: [code] array( "Google", "Yahoo", "MSN" ); [/code] And the array with the links: [code] array( "<a href='http://www.google.com/'>Google</a>", "<a href='http://www.yahoo.com/'>Yahoo</a>", "<a href='http://www.msn.com/'>MSN</a>" );[/code] Alternativly, we could have this: [code] array( "Google" => "<a href='http://www.google.com/'>Google</a>", "Yahoo" => "<a href='http://www.yahoo.com/'>Yahoo</a>", "MSN" => "<a href='http://www.msn.com/'>MSN</a>" ); [/code] But how do I now get this to work!? My itnitial thought was this: [code]<?php $names = array( "Google", "Yahoo", "MSN" ); $links = array( "<a href='http://www.google.com/'>Google</a>", "<a href='http://www.yahoo.com/'>Yahoo</a>", "<a href='http://www.msn.com/'>MSN</a>" ); $txt = preg_replace( "#".$names."#is", $links, $txt ); ?>[/code] However, this of course, did not worsk, and I was produced with this error: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] Warning: preg_replace(): Parameter mismatch, pattern is a string while replacement in an array. in /home/****/public_html/forums/keywords.php on line 15[/quote] So my question is, how do I enable arrays in preg_replace!? Thanks in adavcne for your help, Mark