Ok so I am trying to get the Related Search terms from MSN Live and put them on my site with my links.

Here is the test code I am using.

PHP Code:
<?php
include 'simple_html_dom.php'
$html file_get_html("http://search.live.com/results.aspx?q=house&form=QBLH");
foreach(
$html->find('div[class=qscolumn]') as $related) {
foreach(
$related->find('li') as $related2)
echo 
'<a href="http://kywordpro.com/txt/1/10/' $related2->plaintext '.html" target="blank">' $related2->plaintext '</a><br /> '
}
?>
It works fine as you can see on my test page

The problem is I want to use this code with it

PHP Code:
$search = array(' ''&','(',')',',','%'); 
$replace = array('+''%26','%28','%29','%2C','%25'); 
$subject $related2
$relatedurlstr_replace($search$replace$subject); 
To make the links internet freindly

so my complete code would be

PHP Code:
<?php
include 'simple_html_dom.php'
$html file_get_html("http://search.live.com/results.aspx?q=house&form=QBLH");
foreach(
$html->find('div[class=qscolumn]') as $related) {
foreach(
$related->find('li') as $related2)
$search = array(' ''&','(',')',',','%'); 
$replace = array('+''%26','%28','%29','%2C','%25'); 
$subject $related2
$relatedurlstr_replace($search$replace$subject);
echo 
'<a href="http://kywordpro.com/txt/1/10/' $relatedurl->plaintext '.html" target="blank">' $related2->plaintext '</a><br /> '
}
?>
The problem is when I use teh code as a whole it only displays the last array.

Can anyone help?

Tim...