What is the method for adding a background image in PHP?

In PHP, adding a background image can be achieved using HTML. You can use the following code to add a background image:

<!DOCTYPE html>
<html>
<head>
    <title>背景图示例</title>
</head>
<body style="background-image: url('background.jpg');">
    <h1>这是一个带背景图的页面</h1>
</body>
</html>

In the example above, background.jpg is the path to the background image, which can be replaced with the actual path. Save the above code as a .php file and open it in a browser to see the page with the background image.

bannerAds