初学者有关问题,PHP简单函数有关问题

WBOY
Release: 2016-06-13 13:44:20
Original
798 people have browsed it

菜鸟问题,PHP简单函数问题

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
  public function DisplayStyle()
 {
   ?>    //这里以PHP结束标记开头是怎么回事?
   <style>
        td{
              background:black;
           }
   </style>
  <?php //这里又以PHP开始标记结尾
}

Copy after login

请教各位高手,以上这种写法该怎么理解?

------解决方案--------------------
跟函数的名字一个意思

直接在php 显示 这段代码


------解决方案--------------------
是php的写在里面
不是php的内容,比如那个style写在标记外面
------解决方案--------------------
恩 是的。php 的开始标记。还有一种是php 只有开始------解决方案--------------------
等价于下列代码:

PHP code

  public function DisplayStyle()
 {
  echo "    
   <style>
        td{
              background:black;
           }
   </style>
 ";
} <div class="clear">
                 
              
              
        
            </div>
Copy after login
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