Home >Backend Development >PHP Tutorial >PHP 学习笔记 2011-06-29

PHP 学习笔记 2011-06-29

WBOY
WBOYOriginal
2016-06-23 14:28:49867browse

php常见的区别

1. 单引号和双引号

$abc=”world”;

echo “ni hao $abc”; ---->输出的是:  ni hao world

echo ‘ni hao $abc’;  ----->输出的是: ni  hao $abc

?> 

再如:

echo “ni hao php”; ---->输出的是:  ni hao php

echo ‘ni hao php’;  ---->输出的是: ni  hao php

?> 

2.输出方式: 一共四种方式

print_r($_SERVER['REMOTE_ADDR']."
");
print($_SERVER['REMOTE_ADDR']."
");
echo $_SERVER['REMOTE_ADDR']."
";
printf ($_SERVER['REMOTE_ADDR']."
");

3.声明方式( 四种方式,定义是php代码)

?>

-------------------------

…?>

------------------

----------------

%>

Statement:
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
Previous article:PHP导出Excel方法Next article:PHP UTF-8乱码问题