# Help from PHP and HTML gurus

**URL:** <https://boards.straightdope.com/t/help-from-php-and-html-gurus/422585>\
**Category:** Factual Questions\
**Created:** [October 13, 2007, 3:38pm UTC](https://boards.straightdope.com/t/help-from-php-and-html-gurus/422585 "2007-10-13T15:38:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FatBaldGuy](https://avatars.discourse-cdn.com/v4/letter/f/ecd19e/32.png) [@FatBaldGuy](https://boards.straightdope.com/u/FatBaldGuy)\
**Post date:** [October 13, 2007, 3:38pm UTC](https://boards.straightdope.com/t/help-from-php-and-html-gurus/422585/1 "2007-10-13T15:38:40Z")

</div>

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:

```auto

<?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.

---

<div class="post-metadata">

**Author:** ![Noone\_Special](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/noone_special/32/2863_2.png) [@Noone\_Special](https://boards.straightdope.com/u/Noone_Special)\
**Post date:** [October 13, 2007, 3:43pm UTC](https://boards.straightdope.com/t/help-from-php-and-html-gurus/422585/2 "2007-10-13T15:43:29Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![FatBaldGuy](https://avatars.discourse-cdn.com/v4/letter/f/ecd19e/32.png) [@FatBaldGuy](https://boards.straightdope.com/u/FatBaldGuy)\
**Post date:** [October 13, 2007, 3:51pm UTC](https://boards.straightdope.com/t/help-from-php-and-html-gurus/422585/3 "2007-10-13T15:51:02Z")

</div>

[QUOTE=Noone Special]  
You need to use the substitution string "&nbsp;" (with a trailing semi-colon).

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

Thanks. That did the trick. :smack:
