下面的示例看看这三个函数的具体的区别,其中var_dump和var_export比较少用,但他们两者又很相似。所以可以看看:
复制代码 代码如下:
<?php
$a = array(1,1,32,322,3433,array(32,232,23232));
$b = 1234;
$c = "alsdfl;asdf";
$d = 'a';
$e = fopen("slsl.txt", "r");
var_dump($a);
echo "<br>";
var_dump($b);
echo "<br>";
var_dump($c);
echo "<br>";
var_dump($d);
echo "<br>";
var_dump($e);
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
var_export($a);
echo "<br>";
var_export($b);
echo "<br>";
var_export($c);
echo "<br>";
var_export($d);
echo "<br>";
var_export($e);
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
print_r($a);
echo "<br>";
print_r($b);
echo "<br>";
print_r($c);
echo "<br>";
print_r($d);
echo "<br>";
print_r($e);
echo "<br>";
输出:
复制代码 代码如下:
Warning: fopen(slsl.txt) [function.fopen]: failed to open stream: No such file or directory in E:\mywww\yangtest\base1.php on line 6
array(6) { [0]=> int(1) [1]=> int(1) [2]=> int(32) [3]=> int(322) [4]=> int(3433) [5]=> array(3) { [0]=> int(32) [1]=> int(232) [2]=> int(23232) } }
int(1234)
string(11) "alsdfl;asdf"
string(1) "a"
bool(false)
array ( 0 => 1, 1 => 1, 2 => 32, 3 => 322, 4 => 3433, 5 => array ( 0 => 32, 1 => 232, 2 => 23232, ), )
1234
'alsdfl;asdf'
'a'
false
Array ( [0] => 1 [1] => 1 [2] => 32 [3] => 322 [4] => 3433 [5] => Array ( [0] => 32 [1] => 232 [2] => 23232 ) )
1234
alsdfl;asdf
a
现在可以看到效果了,注意,最后一个不是我没有粘贴过来,而是他本来就没有显示什么东西。
复制代码 代码如下:
<?php
$a = array(1,1,32,322,3433,array(32,232,23232));
$b = 1234;
$c = "alsdfl;asdf";
$d = 'a';
$e = fopen("slsl.txt", "r");
var_dump($a);
echo "<br>";
var_dump($b);
echo "<br>";
var_dump($c);
echo "<br>";
var_dump($d);
echo "<br>";
var_dump($e);
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
var_export($a);
echo "<br>";
var_export($b);
echo "<br>";
var_export($c);
echo "<br>";
var_export($d);
echo "<br>";
var_export($e);
echo "<br>";
echo "<br>";
echo "<br>";
echo "<br>";
print_r($a);
echo "<br>";
print_r($b);
echo "<br>";
print_r($c);
echo "<br>";
print_r($d);
echo "<br>";
print_r($e);
echo "<br>";
输出:
复制代码 代码如下:
Warning: fopen(slsl.txt) [function.fopen]: failed to open stream: No such file or directory in E:\mywww\yangtest\base1.php on line 6
array(6) { [0]=> int(1) [1]=> int(1) [2]=> int(32) [3]=> int(322) [4]=> int(3433) [5]=> array(3) { [0]=> int(32) [1]=> int(232) [2]=> int(23232) } }
int(1234)
string(11) "alsdfl;asdf"
string(1) "a"
bool(false)
array ( 0 => 1, 1 => 1, 2 => 32, 3 => 322, 4 => 3433, 5 => array ( 0 => 32, 1 => 232, 2 => 23232, ), )
1234
'alsdfl;asdf'
'a'
false
Array ( [0] => 1 [1] => 1 [2] => 32 [3] => 322 [4] => 3433 [5] => Array ( [0] => 32 [1] => 232 [2] => 23232 ) )
1234
alsdfl;asdf
a
现在可以看到效果了,注意,最后一个不是我没有粘贴过来,而是他本来就没有显示什么东西。
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
桃源资源网 Design By www.nqtax.com
暂无“解析php中var_dump,var_export,print_r三个函数的区别”评论...
稳了!魔兽国服回归的3条重磅消息!官宣时间再确认!
昨天有一位朋友在大神群里分享,自己亚服账号被封号之后居然弹出了国服的封号信息对话框。
这里面让他访问的是一个国服的战网网址,com.cn和后面的zh都非常明白地表明这就是国服战网。
而他在复制这个网址并且进行登录之后,确实是网易的网址,也就是我们熟悉的停服之后国服发布的暴雪游戏产品运营到期开放退款的说明。这是一件比较奇怪的事情,因为以前都没有出现这样的情况,现在突然提示跳转到国服战网的网址,是不是说明了简体中文客户端已经开始进行更新了呢?