Help from PHP and HTML gurus

I’m building a web page, and I want to include a list of links, but I don’t want the browser to wrap in the middle of one of the links. I’m using code similar to the following:


<?php
$pageDescrip = "Bob Smith";
$displayName = str_replace(" ","&nbsp",$pageDescrip);
echo '<a href="http://www.bobsmith.com">'.$displayName.'</a>';
?>


This works fine with IE, but in Firefox, the link displays as Bob&nbspSmith.

Any suggestions on how to work around this would be appreciated.

You need to use the substitution string " " (with a trailing semi-colon).

I guess IE lets you use the “wrong” syntax as a shortcut; FireFox is stricter.

Thanks. That did the trick. :smack: