Correcting teacher:PHPz
Correction status:qualified
Teacher's comments:
<?php
//if分支
$a = "阴天" ;
if($a == "晴天"){
echo "爬山去";
}else if($a == '阴天'){
echo "依然爬山";
}else {
echo "加班";
}
echo '<br>';
//三元 ?:
$f = '';
echo $f ?'出去吃饭':'回家睡觉';
echo '<br>';
//加密
echo md5('admin');
echo '<br>';
echo strlen('21232f297a57a5a743894a0e4a801fc3');
echo '<br>';
echo sha1('admin');
echo '<br>';
echo strlen('d033e22ae348aeb5660fc2140aec35850c4da997');
echo '<br>';
//数组或者对象中属性个数 count
$arr = [
'niHao',
'meiHao',
123,
'欧呦',
];
echo count($arr);
echo '<br>';
//初始化 unset
//合并函数 array_merge
$item1 = [
1,
2,
3,
4,
];
$item2 = [
2,
3,
4,
];
print_r (array_merge($item1,$item2));
echo '<br>';
//去重 array_unique
print_r (array_unique(array_merge($item1,$item2)));
echo '<br>';
//数组转字符 implode
echo implode('==',$item2);
echo '<br>';
//字符转数组 explode
$str = '欧阳克1灭绝师太2朱老师3西门大官人';
print_r (explode('1',$str));
// & 地址引用符