Blogger Information
Blog 8
fans 0
comment 0
visits 5811
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
8月21日php环境的搭建以及PHP基本语法字符转译等!
PHP入门学习的各种作业
Original
648 people have browsed it

今天主要学习了,如何搭建php环境以及如何建立虚拟主机。还有php运行原理与解析原理。php的基本语法<?php  ?>,在只有php的时候  ?>可以省略。php可以嵌入到html的任何位置。一般打印标签为echo与print,常用echo,俩个用法基本一样,print有返回值1.

实例

<?php
$name = 'php中文网';
echo $name, '<br>';
$name = 'wwwphp中文网';
echo $name;
$age = '18';
echo '<hr>';
echo  $name.'已\'一号\'经'.$age.'了!';
ECHO '<hr>';
//heredoc 相当于双引号的字符串,可以解析内部变量和转译特殊字符
//nowdoc 相当于单引号包装的字符串,单引号里不能解析变量,但是必须加单引号
echo <<< "heredoc"
{$name}  \n  \r
heredoc;
echo <<< 'nowdoc'
<h3>nowdoc相当于单引号,不能解析变量。</h3>
nowdoc;

运行实例 »

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

21.png

Correction status:qualified

Teacher's comments:heredoc和nowdoc与前面的符号之间最好不要留空格!
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