Replace HTML tag contents PHP

It took me a lot of looking around to find a proper regex expression to pick out the value of an HTML tag. Too bad I was looking in the wrong places...

To replace the value of a tag you can use PHP code like this: $buffer=preg_replace -- meh, broken in ScribbleWeb

This was used in the callback function of an output buffer, to replace the title tag value (Long story).

This sample is based on the user notes from the site here:

Update: be careful, the php code line above is screwed up due to an bug in the ScribbleWeb - there are extra slashes in there...

tags: regex, php

Related Scribbles:
  • Text (and Word Document) Editing
  • Regex Examples and Tools

  • ID: 265
    Date Updated:
    2014-11-16 20:46:42
    Date Created:
    2003-08-23 01:55:15


     >> Leonard Chan's Homepage  >> Scribble Web  >> Replace HTML tag contents PHP is hosted by Perceptus Solutions Inc.