PHP基本语法学习笔记

PHP学习笔记

";
$arr=array(1,2,3,4);
print_r($arr);
echo "
"; echo $arr[0]; echo "
"; $dict=array("name"=>"yaoyi","age"=>"21"); print_r($dict); echo "
"; echo $dict["name"]; $num1=-111; var_dump($num1); echo strpos("nihao sad","sad"); define("nihao","woshinibaba",false); echo "
"; echo nihao; echo "
"; $cars=array("yy","yaoyi","yorkmass"); foreach ($cars as $value1){ echo $value1."
"; } $persons=array("yy"=>"12","yorkmass"=>"110","yaoyi"=>"22"); foreach ($cars as $name){ echo $name."今年".$persons[$name]."岁"."
"; } ?>

输出

 

10
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 ) 
1
Array ( [name] => yaoyi [age] => 21 ) 
yaoyiint(-111) 6
woshinibaba
yy
yaoyi
yorkmass
yy今年12岁
yaoyi今年22岁
yorkmass今年110岁

 

你可能感兴趣的:(php)