From 138193d85418eb36ea2c7c8e09abfde58f184638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E6=95=8F=E5=8D=8E?= <2557181397@qq.com> Date: Mon, 16 May 2022 20:58:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...27\347\254\246\347\273\203\344\271\240.md" | 0 ...75\346\225\260\347\273\203\344\271\240.md" | 53 +++++++++++++++++++ 2 files changed, 53 insertions(+) rename "\350\260\255\346\225\217\345\215\216/20220515-PHP\347\273\203\344\271\240.md" => "\350\260\255\346\225\217\345\215\216/20220511-PHP\347\273\203\344\271\240\345\276\252\347\216\257\344\270\216\350\277\220\347\256\227\347\254\246\347\273\203\344\271\240.md" (100%) create mode 100644 "\350\260\255\346\225\217\345\215\216/20220516-PHP\346\225\260\347\273\204\344\270\216\345\207\275\346\225\260\347\273\203\344\271\240.md" diff --git "a/\350\260\255\346\225\217\345\215\216/20220515-PHP\347\273\203\344\271\240.md" "b/\350\260\255\346\225\217\345\215\216/20220511-PHP\347\273\203\344\271\240\345\276\252\347\216\257\344\270\216\350\277\220\347\256\227\347\254\246\347\273\203\344\271\240.md" similarity index 100% rename from "\350\260\255\346\225\217\345\215\216/20220515-PHP\347\273\203\344\271\240.md" rename to "\350\260\255\346\225\217\345\215\216/20220511-PHP\347\273\203\344\271\240\345\276\252\347\216\257\344\270\216\350\277\220\347\256\227\347\254\246\347\273\203\344\271\240.md" diff --git "a/\350\260\255\346\225\217\345\215\216/20220516-PHP\346\225\260\347\273\204\344\270\216\345\207\275\346\225\260\347\273\203\344\271\240.md" "b/\350\260\255\346\225\217\345\215\216/20220516-PHP\346\225\260\347\273\204\344\270\216\345\207\275\346\225\260\347\273\203\344\271\240.md" new file mode 100644 index 0000000..0989529 --- /dev/null +++ "b/\350\260\255\346\225\217\345\215\216/20220516-PHP\346\225\260\347\273\204\344\270\216\345\207\275\346\225\260\347\273\203\344\271\240.md" @@ -0,0 +1,53 @@ +```php+HTML +"; + +//2、 至少对3个字符串函数进行应用 +$str= " hello boy "; +echo strtoupper($str)."
"; +echo trim($str)."
"; +echo ltrim($str); +echo "
"; + +//3、 写一段程序,创建一个数组,其元素内容为从1到20的所有整数,并输出该数组。 +//$arr=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20); +$arr=array(); +for($i=0;$i<20;$i++){ + $arr[$i]=$i+1; +} +foreach ($arr as $a){ + echo $a." "; +} +echo "
"; + +//4、 写一段代码,查找数组中是否存在某一个指定的元素,如果存在则返回数组的索引。 + +find(15,$arr);//这里的数组用上面的数组$arr +echo $find; +function find($x,$arr){ + for($i=0;$i"; + +//5、 写一段程序,创建一个关联数组,其元素是姓名,年龄,性别等个人信息,并输出该数组。 +cj("张三",18,"男"); +function cj($a,$b,$c){ + $arr2=array("name"=>$a,"age"=>$b,"sex"=>$c); + // 遍历 + foreach($arr2 as $key=>$p){ + echo "$key=".$p."
"; + } +} +``` + -- Gitee