上一页 1 2 3 4 5 6 ··· 31 下一页
摘要: <?php //$arr是一个关联数组,有5个成员 //name,sex,age,education,mobile $users = [ 'name' => ['张三','李四','王五','赵六'], 'sex' => ['男','女','女','男'], 'age' => [12,13,14,1 阅读全文
posted @ 2020-03-11 23:01 lujieting0 阅读(121) 评论(0) 推荐(0) 编辑
摘要: <?php $arr = [ ['张三','男','22'], ['李四','女','23'], ['王五','男','24'], ['赵六','女','25'], ]; //张三,男,22|李四,女,23|王五,男,24|赵六,女,25 foreach ($arr as $item){ $temp 阅读全文
posted @ 2020-03-11 22:59 lujieting0 阅读(126) 评论(0) 推荐(0) 编辑
摘要: <?php //包含了N多个人的基本信息(姓名、性别、年龄) $str = '张三,男,22|李四,女,23|王五,男,17'; /** * $arr = [ * ['张三','男',22]; * ['张三','男',22]; * ['张三','男',22]; * ]; * */ //转换成 $ar 阅读全文
posted @ 2020-03-11 22:57 lujieting0 阅读(840) 评论(0) 推荐(0) 编辑
摘要: <?php $products = [ ['id' => 1, 'productName' => '商品1', 'productsPrice' => 500, 'productImage' => 'a1.jpg'], ['id' => 2, 'productName' 阅读全文
posted @ 2020-03-11 22:56 lujieting0 阅读(206) 评论(0) 推荐(0) 编辑
摘要: <?php $arr = ['C','D','E']; echo '原数组有', count($arr), '个成员'; echo '他们是:', implode(',',$arr); $length = array_unshift($arr,'A','B'); echo '现有',$length, 阅读全文
posted @ 2020-03-11 22:47 lujieting0 阅读(238) 评论(0) 推荐(0) 编辑
摘要: <?php $arr = 'GIF','JPG','PNG','SWF','PSD']; // foreach ($arr as $value){ // $temp[] = strtolower($value); // } // print_r($temp); $arr = array_map('s 阅读全文
posted @ 2020-03-11 22:44 lujieting0 阅读(115) 评论(0) 推荐(0) 编辑
摘要: <?php //end() 与 count($array)-1 的区别 $filename = 'a.b.c.jpg'; $array = explode('.', $filename); echo end($array); echo $array[count($array)-1]; $array  阅读全文
posted @ 2020-03-11 22:42 lujieting0 阅读(226) 评论(0) 推荐(0) 编辑
摘要: <?php echo strpos('abcd','a'),'<hr>'; var_dump(strpos('abcd','C')); var_dump(stripos('abcd','C')); var_dump(strrpos('abcd','a')); //获取文件的扩展名 $filename 阅读全文
posted @ 2020-03-11 22:38 lujieting0 阅读(116) 评论(0) 推荐(0) 编辑
摘要: <?php //经典写法 $str = 'ZEND_ConTROLLeR_fRonT'; //全部转换成小写字母 $str = strtolower($str); //将zend_controller_front通过str_replace函数变成 $str = str_repeat('_',' ', 阅读全文
posted @ 2020-03-11 22:35 lujieting0 阅读(148) 评论(0) 推荐(0) 编辑
摘要: <?php $str = 'JavaScript'; echo substr($str,0,4),'<hr>'; echo substr($str,4),'<hr>'; $str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz12345 阅读全文
posted @ 2020-03-11 22:34 lujieting0 阅读(97) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 31 下一页