Can php change html content?

藏色散人
Release: 2023-03-09 07:26:01
Original
2719 people have browsed it

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;这个值改变为用户提交的
?>
Copy after login

Implementation method:

The code is as follows:

<body>
<h1><?php echo $text; ?><h1>
</body>
Copy after login

[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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template