" in the HTML code."/> " in the HTML code.">

Home >Backend Development >PHP Problem >Can php change html content?

Can php change html content?

藏色散人
藏色散人Original
2021-03-29 09:24:172751browse

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.

Can php change html content?

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[&#39;text&#39;];
//我想要的效果就是,当用户访问并提交text参数时,能够将上面的html文件中的&#39;马云&#39;这个值改变为用户提交的
?>

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn