批改状态:合格
老师批语:
<?php
$aa=new stdClass();
$aa->name = 'pengli';
echo "<pre>";
print_r($aa);
var_dump($aa);
echo "<hr>";
$output='输出函数:(echo print)输出单一变量 (print_r var_dump)输出数组,对象';
echo $output.'<hr>';
$arr='数组创建:$a=[]; 对象创建:$b=new stdClass()';
echo $arr.'<hr>';
$type='变量类型查看:gettype(变量)';
$a='';
$b;
$c=0;
$d=null;
$e=[];
$f=new stdClass();
echo gettype($a).'<hr>';
echo gettype($b).'<hr>';
echo gettype($c).'<hr>';
echo gettype($d).'<hr>';
echo gettype($e).'<hr>';
echo gettype($f).'<hr>';
echo $type.'<hr>';
$typechange='类型转换(int) (string) intval($) stringval($) 永久转换:settype(改变原来类型)';
echo $typechange.'<hr>';
$detection='变量类型检测:返回的是布尔类型 is_integer() is_integer() is_string() is_null() is_numeric(0) unset($)销毁变量 isset(是否初始化变量) empty(是否为空 0 null 都为空)';
echo $detection.'<hr>';
$g='全局变量:GLOBALS[name]';
echo $g.'<hr>';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
<script>
var a={age:20};
a.name="pengli";
console.log(a);
</script>
</html>点击 "运行实例" 按钮查看在线实例



Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号