in reply to Matching text in a string
You never show us where you actually output $text. Also, you don't show us the values of $firstname and the overall program logic.
Also, consider what happens when my firstname is A - do you really want to skip adding my first name then?
Update: Also see BrowserUks reply, which points out the more likely the cause of your immediate problem.
Update 2: You really should consider using a template system instead of trying to munge HTML that has already been created afterwards. First create all the data you need and then create the HTML. Don't create HTML while running through your program.
|
|---|