example i display the query in a echo something like mydomain.com/$title1.html but when they contain spaces the url ends up with %20 and i would rather them be underscores, ive searched everywhere and see its not that hard but i cant seem to implement it correctly on the script $query = "select * from mytable WHERE address LIKE '%$trimmed%' "; // now you can display the results returned while ($row= mysql_fetch_array($result)) { $title1 = $row["name"]; echo "<a href=http://www.mydomain.com/$title1.html ";
I think you're looking for str_replace? <?php // replace $title1 = $row["name"]; with: $title1 = str_replace(" ", "_", $row["name"]); ?> PHP: