700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > md语法语法_PHP –语法概述

md语法语法_PHP –语法概述

时间:2019-02-07 10:17:31

相关推荐

md语法语法_PHP –语法概述

md语法语法

[rps-include post=6522]

[rps-include post = 6522]

延期 (Extension)

Php source or code files generally ends with.phpbut generally the extension is not important. Following extensions can be used too.

php源文件或代码文件通常以.php结尾,但扩展名通常并不重要。 也可以使用以下扩展名。

php4php4 php5php5 php7php7

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.

下面我们可以在这里看到新代码。

<?phpecho "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 commentecho "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 multilinecomment*/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><?phpecho "Hi ";?></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 examplecatis not the same asCATorCat. All of them are different.

php是区分大小写的编程语言。 区分大小写只是意味着将具有大写和小写字母的相同单词解释为不同的单词。 例如catCATCat。 他们都是不同的。

LEARN MORE HTML Bold Tag Usage and Examples了解更多HTML粗体标记的用法和示例

[rps-include post=6522]

[rps-include post = 6522]

翻译自: /php-syntax-overview/

md语法语法

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。