From 708052a0535aa9ede56c84473a097e4266c5a635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=A2=81=E6=9D=B0?= <2335099731@qq.com> Date: Mon, 16 May 2022 21:29:06 +0800 Subject: [PATCH] 20220516 --- .../20220516-PHP\345\207\275\346\225\260.md" | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 "\351\231\210\346\242\201\346\235\260/20220516-PHP\345\207\275\346\225\260.md" diff --git "a/\351\231\210\346\242\201\346\235\260/20220516-PHP\345\207\275\346\225\260.md" "b/\351\231\210\346\242\201\346\235\260/20220516-PHP\345\207\275\346\225\260.md" new file mode 100644 index 0000000..bdd364b --- /dev/null +++ "b/\351\231\210\346\242\201\346\235\260/20220516-PHP\345\207\275\346\225\260.md" @@ -0,0 +1,35 @@ +```php+HTML +"; +//2、至少对3个字符串函数进行应用 +$str=" i am a student "; +echo trim($str)."
"; +echo ucwords($str)."
"; +echo strtoupper($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); + +for ($i=0;$i"; +//4、写一段代码,查找数组中是否存在某一个指定的元素,如果存在则返回数组的索引。 +$arr = array("name"=>"张三","age"=>"18"); +echo array_search(18,$arr); +echo "
"; +//5、写一段程序,创建一个关联数组,其元素是姓名,年龄,性别等个人信息,并输出该数组。 +$arr = array("name"=>"张三","age"=>"18","sex"=>"男"); +foreach ($arr as $key => $s){ + echo $key.= $s; +} +``` \ No newline at end of file -- Gitee