Link to home
Start Free TrialLog in
Avatar of lucavilla
lucavillaFlag for Italy

asked on

substituting a specified text in a file

from a file modifer.php I need to modify another file index.php substituting the text:
<div id=change this>foobar</div>

with this new text:
<div id=change this>abcdefghi</div>

what are the PHP commands to do this?
SOLUTION
Avatar of QualitySoftwareDevelopment
QualitySoftwareDevelopment

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lucavilla

ASKER

marchent, what's the minimalist way to do the same?
don't know that.
Avatar of QualitySoftwareDevelopment
QualitySoftwareDevelopment

it really depends on how much you know of the existing string. If the <div id=change this> and </div> is always the same marchents pretty much the shortest way.