![md语法语法](https://i-blog.csdnimg.cn/blog_migrate/b56ce152cc345b6b5e93749574531f39.png)
md语法语法
[rps-include post=6522]
[rps-include post = 6522]
延期 (Extension)
Php source or code files generally ends with .php
but generally the extension is not important. Following extensions can be used too.
php源文件或代码文件通常以.php
结尾,但扩展名通常并不重要。 也可以使用以下扩展名。
- php4 php4
- php5 php5
- php7 php7
php标签 (Php Tags)
Web based programming languages generally uses tags in order to surround related code. Php is web based programming language too and uses <?php ... ?>
tags. Second tag is not compulsory if the code ends without different language but makes the code more elegant .
基于Web的编程语言通常使用标签来包围相关代码。 PHP也是基于Web的编程语言,并使用<?php ... ?>
标记。 如果代码结尾没有其他语言,则第二个标签不是强制性的,而是使代码更加优雅。
Below we can see new code here.
下面我们可以在这里看到新代码。
<?php
echo "Hi";
?>
分号 (Semicolons)
Php is C and C++ centric language and uses semicolons to specify end of statement. Each semicolon end the line or statement like below.
Php是以C和C ++为中心的语言,并使用分号指定语句结尾。 每个分号都以下面的行或语句结尾。
echo "This is a line";
echo "This is a line too";
There is another usage of semicolons too. We can use multiple semicolons for multiple statements like below.
分号也有另一种用法。 我们可以对多个语句使用多个分号,如下所示。
echo "This is a line"; echo "This is a line too";
评论 (Comments)
While developing applications we generally need to take notes on code or insert some explanation about the code. We call these explanation comment. comments do not have any effect on application run time.
在开发应用程序时,我们通常需要记下代码或插入一些有关代码的说明。 我们称这些解释为评论。 注释对应用程序运行时间没有任何影响。
// This is a comment
echo "This is a line"; //This is a comment to
We can also specify comments after end of the statement like the second example
我们也可以像第二个示例一样在语句结束后指定注释
多行注释(Multiline Comments)
Sometimes single line comments are not enough. We can specify multi line comments with /*
and */
like below.
有时单行注释是不够的。 我们可以使用/*
和*/
指定多行注释,如下所示。
/*
This is a multiline
comment
*/
echo "hi";
嵌入HTML (Embed Into Html)
Php code can be embedded into Html code easily. In the server side first the php code is executed and the result is put into related position. Below a code is embedded into html.
php代码可以轻松地嵌入到HTML代码中。 首先在服务器端执行php代码,并将结果放入相关位置。 下面的代码嵌入到html中。
<html>
<body>
<?php
echo "Hi poftut.com";
?>
</body>
</html>
区分大小写 (Case Sensitivity)
Php is case sensitive programming language. Case sensitive simply means the same word with uppercase and lowercase are interpreted as different. For example cat
is not the same as CAT
or Cat
. All of them are different.
php是区分大小写的编程语言。 区分大小写只是意味着将具有大写和小写字母的相同单词解释为不同的单词。 例如cat
与CAT
或Cat
。 他们都是不同的。
[rps-include post=6522]
[rps-include post = 6522]
md语法语法