" in the HTML code."/> " in the HTML code.">
Home >Backend Development >PHP Problem >Can php change html content?
php can change the HTML content. The specific implementation method is: first open the corresponding code file; then add the PHP statement as "" in the HTML code.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
php modify the html text content
Specific questions:
For example, there is a piece of html code
<body> <h1>马云<h1> </body> 然后有段php代码 <?php $text=$_GET['text']; //我想要的效果就是,当用户访问并提交text参数时,能够将上面的html文件中的'马云'这个值改变为用户提交的 ?>
Implementation method:
The code is as follows:
<body> <h1><?php echo $text; ?><h1> </body>
[Recommended learning: PHP video tutorial]
The above is the detailed content of Can php change html content?. For more information, please follow other related articles on the PHP Chinese website!