How to replace html text with php
This article is about how php replaces html text. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Php to replace html text: 1, create a PHP sample file; 2, define a $string variable; 3, through the "str_replace ('xx',' xwords, $string);" way to replace the text in html.
This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer
The specific problems are described as follows:
How does php replace html text?
Example:
Hello
Hello
Hello
How to replace these three "Hello" with "good" with php code?
Implementation method:
The code is as follows: