From ce273bf72a6ae3f5c169170af118ef2ee705d083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E8=A3=95?= <895585435@qq.com> Date: Mon, 16 May 2022 14:33:42 +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 --- ...60\347\273\204\344\275\234\344\270\232.md" | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 "\346\242\201\350\243\225/20220516-\346\225\260\347\273\204\344\275\234\344\270\232.md" diff --git "a/\346\242\201\350\243\225/20220516-\346\225\260\347\273\204\344\275\234\344\270\232.md" "b/\346\242\201\350\243\225/20220516-\346\225\260\347\273\204\344\275\234\344\270\232.md" new file mode 100644 index 0000000..5388e76 --- /dev/null +++ "b/\346\242\201\350\243\225/20220516-\346\225\260\347\273\204\344\275\234\344\270\232.md" @@ -0,0 +1,46 @@ +```php +"; + +//2、 至少对3个字符串函数进行应用 +$k = " how do you do ! " ; +echo trim($k)."
";//去除字符串左右两端的空格 +echo ucwords($k)."
";//每个单词首字母大写 +echo str_word_count($k);//统计单词个数 +echo "
"; + +//3、 写一段程序,创建一个数组,其元素内容为从1到20的所有整数,并输出该数组。 +$b = array(); +for ($i=0;$i<20;$i++){ + $b[$i]=$i+1; +} +foreach ($b as $d){ + echo $d." "; +} +echo "
"; + +//4、 写一段代码,查找数组中是否存在某一个指定的元素,如果存在则返回数组的索引。 +$v = array(7,3,5,1,6,9); +find(5,$v); +function find($c,$v){ + for ($i=0;$i"; + +//5、 写一段程序,创建一个关联数组,其元素是姓名,年龄,性别等个人信息,并输出该数组。 +$y = array("name"=>"李四","age"=>"20岁","sex"=>"男"); +$g = implode(',',$y); +echo $g; +``` \ No newline at end of file -- Gitee