Mr.秦
2016-03-07 11:03
<?php
echo $m1 = memory_get_usage(); //获取当前PHP消耗的内存值,并赋值给m1
echo "<br />";//输出当前PHP消耗的内存值
$var_string = "12";//定义var_string变量值为“12”
echo $m2 = memory_get_usage()-$m1; //赋值给m2,获取当前PHP消耗的内存值,并减去m1的值就是变量var_string所消耗的内存值
echo "<br />";//输出消耗的的内存值,以下类同
$n = "123";
echo $m3 = memory_get_usage()-$m1-$m2;
echo "<br />";
$f = "123.00";
echo $m4 = memory_get_usage()-$m1-$m2-$m3;
echo "<br />";
$var_array = array("123");
echo $m5 = memory_get_usage()-$m1-$m2-$m3-$m4;
?>
就是这个意思
<?php
echo $m1 = memory_get_usage(); //获取当前PHP消耗的内存值,并赋值给m1 并输出m1
echo "<br />";
$var_string = "12";//定义var_string变量名并附值为“12”
echo "<br />";是回车,赋值和输出是同一个echo进行的,比如echo $m1 = memory_get_usage();
PHP入门篇
455956 学习 · 6306 问题
相似问题