Blogger Information
Blog 25
fans 0
comment 0
visits 18812
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
220作业
℃级的博客
Original
668 people have browsed it

php的功能和原理:在前台页面php(服务器php.exe解析的脚本语言写的)进行服务器请求时,服务器获取到后,交给php.exe进行解析处理后,将解析的html脚本通过apache服务器返回给前台浏览器,浏览器展示出html构成的页面供给大家看。

实例

<?php
$title='2019';
define('ST_NAME', 'NAMEE'); //可以运算,类里不支持define
const STT='1111';  //不能运算,类里可以用的常量
$tablename=ST_NAME.'哈迪';
$tablename='<a href="">'.ST_NAME.'</a>'.'哈迪';//常量在变量中
$user=[1,'诸葛',30,'男','@111','121212'];
echo '<pre>';
print_r($user);
$uu=[
     'id'=>1,
     'name'=>'啊',
     'age'=>12,
      'sex'=>'男',
      'email'=>'@111',
      'password'=>'122'
    ];
    foreach ($uu as $key => $value) {
    	echo $key."值是".$value.'<br>';
    	    }
 ?>

<!DOCTYPE html>
<html lang="en">
<head>


<meta charset="utf-8">
	<title><?=$title?></title>
</head>
<body>
<table>
<caption><?=$title ?></caption>
  <thead>
    <tr>
       <th>1</th>
       <th>2</th>
       <th>3</th>
       <th>4</th>
    </tr>
  </thead>
     <tbody>
     <?php
       echo '<tr>';  
         echo '<td>1</td>';
       echo  '<td>2</td>';
       echo  '<td>3</td>';
        echo '<td>'.$uu['id'].'</td>';
       echo '</tr>';
         ?>
     </tbody>
</table>
</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post