php-general | 2005051
Date: 05/11/05
- Next message: Joe Harman: "Re: [PHP] base64_encode in URLs"
- Previous message: Dan Rossi: "Re: [PHP] include remote class"
- Next in thread: Marek Kilimajer: "Re: [PHP] marking words bold"
- Reply: Marek Kilimajer: "Re: [PHP] marking words bold"
- Reply: Philip Hallstrom: "Re: [PHP] marking words bold"
- Reply: Murray @ PlanetThoughtful: "RE: [PHP] marking words bold"
- Reply: Stephen Johnson: "Re: [PHP] marking words bold"
- Maybe reply: tg-php <email protected>: "Re: [PHP] marking words bold"
- Reply: AC: "[PHP] Re: marking words bold"
- Reply: AC: "[PHP] Re: marking words bold"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi there,
I am trying to mark words inside a sentence bold. Problem is, if there is an
overlap it does not work anymore.
I am using this code: $t = str_replace($word, "<b>$word</b>", $text);
For eample:
Mark those words bold: adventure in singapore
Text: My adventure flying to singapore
The problem lays in the word "in". The code I use does produce following:
<b>s<b>in</b>gapore</b>
which of course does not work properly.
Does anybody have a good sugestion on how to improve this?`
Thank you for any help,
merlin
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Joe Harman: "Re: [PHP] base64_encode in URLs"
- Previous message: Dan Rossi: "Re: [PHP] include remote class"
- Next in thread: Marek Kilimajer: "Re: [PHP] marking words bold"
- Reply: Marek Kilimajer: "Re: [PHP] marking words bold"
- Reply: Philip Hallstrom: "Re: [PHP] marking words bold"
- Reply: Murray @ PlanetThoughtful: "RE: [PHP] marking words bold"
- Reply: Stephen Johnson: "Re: [PHP] marking words bold"
- Maybe reply: tg-php <email protected>: "Re: [PHP] marking words bold"
- Reply: AC: "[PHP] Re: marking words bold"
- Reply: AC: "[PHP] Re: marking words bold"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

