<?php
//<!--//注释方式-->
//<!--//echo 后面跟字符串;-->
//<!--print("123");-->
//<!--print_r(1,2);-->
//<!--var_dump("1");-->
//$x = "a";
//$a = "123";
//--echo $$x;
//$x = "a";
//$a = "123";
//echo $$x;
//echo 123;
//$x="a";
//$a=123;
//echo $$x;
$x = "1";
$y = 1;
echo gettype($x);
//换行
echo "<br />";
echo gettype($y);
echo "<br />";
//看返回值是什么类型,此处为布尔型;
echo gettype(is_string($x));
echo "<br>";
//ture
unset($y);
//直接输出false;
var_dump(isset($y));
//转类型使用:settype
echo "<br>";
//敲黑板
$a = "";
$b = null;
var_dump(isset($a));
var_dump(empty($a));
echo "<br>";
var_dump(isset($b));
var_dump(empty($b));
//点变成箭头了
$time = new DateTime();
$time->getTimestamp();
$arr = [1,2,3];
$arr2 = [
"name"=>1,
1=>2,
2=>3
];
array_push($arr,4);
array_pop($arr);
count($arr);
for ($i=0;$i<count($arr);$i++){
var_dump($arr[$i]);
}
//第一种
foreach($arr as $biande){
var_dump($biande);}//第二种foreach($arr as $index => $value){}