PHP语法基础一

1.1一个典型的HTML页面

<!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>First PHP Script</title>
        
</head>
<body>

<?php phpinfo(); 
?>

</body>
</html>

PHP代码放置在<?php

More Html  

 ?>之间http://localhost:3000/phpinfo.php

1.2 使用FTP

如果使用服务器学习,可以安装FTP,更新上传文件,否则可省这一步。

FileZilla(http://filezilla-project.org/)

sudo apt-get update
sudo apt-get install filezilla

或者安装参考:

https://blog.csdn.net/dally2/article/details/131930540

1.3 在浏览器中测试

新建一个HTML文档,命名为hello.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>Hello,world!</title>
        
</head>
<body>

<p>
    The following was created by PHP:
    
 <?php 
print "Hello,world!"; 
//print "<span style=\"font-weight:bold";\">Hello,world!</span>";
?>   

</p>


</body>
</html>

1.4 php使用手册

www.php.net/print

1.5 注释方法

//单行注释

/*

*多行注释

*/

参考

PHP for the Web: Visual QuickStart Guide (5th Edition) | Larry Ullman

GitHub - LarryUllman/phpvqs-5ed: PHP for the Web: ,Visual QuickStart GuideGitHub - LarryUllman/phpvqs-5ed: PHP for the Web: ,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值