初识PHP变量
Posted 南笙一梦
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了初识PHP变量相关的知识,希望对你有一定的参考价值。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/
DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Predefined Variables</title>
</head>
<body>
<?php # -- Script 1.5 - predefine.html --
# Script 1.1 - predefined.php
# Created July 1,2016
# Created by 赵志君
// Create a shorthand version of the variable names:
$file = $_SERVER['SCRIPT_FILENAME'];
$user = $_SERVER['HTTP_USER_AGENT'];
$server = $_SERVER['SERVER_SOFTWARE'];
// Print the name of this script:
echo "<p>You are running the file:<br /><b>$file</b>.</p>\\n";
// Print the user's information:
echo "<p>You are viewing this page using:<br /><b>$user</b>.</p>\\n";
// Print the server's information:
echo "<p>This server is running:<br /><b>$server</b>.</p>\\n";
?>
</body>
</html>
英文好多,有点崩溃。
以上是关于初识PHP变量的主要内容,如果未能解决你的问题,请参考以下文章