Home > Backend Development > PHP Tutorial > Several styles of php code

Several styles of php code

WBOY
Release: 2016-07-29 08:55:31
Original
1631 people have browsed it

Several styles of embedding php code in HTML

<code><span><span>html</span>></span><span>head</span>><span>meta</span><span>charset</span>=<span>"utf-8"</span>><span>title</span>> New Document <span><span>title</span>></span><span><span>head</span>></span><span>body</span>><span><span><?php </span><span>echo</span><span>'标准写法,类似xml写法'</span>.<span>'<br>'</span>;
  <span>echo</span><span>'我后面的分号可以省略的,但是不推荐<br>'</span><span>?></span></span><span>script</span><span>language</span>=<span>"php"</span>></span><span>    echo<span>'这是脚本风格的标记'</span>.<span>'<br>'</span>; 

  </span><span><span>script</span>></span><span><span></span><span>//需要在php.ini 设置short _open_tag=on</span><span>echo</span><span>"短标签的写法"</span>.<span>'<br>'</span>;

  <span>?></span></span><span>on</span>
   echo <span>"这是asp风格"</span>.<span>'<br>';</span>
  %><span><span>body</span>></span><span><span>html</span>></span><span><span><?php </span><span>echo</span><span>'当php后面没有非php代码,最后的结束标记可以省略!!'</span>;
<span>#shell风格注释</span><span>//单行注释</span><span>/*
*我是多行注释
*/</span></span></span></code>
Copy after login

Several styles of php code

').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above has introduced several styles of PHP code, including aspects of content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template