03 2020 档案

摘要:<?php //想要获取a.jpg这个文件名的基本信息 // require '10_return.php'; require 'library/strinf.php'; print_r(getFileInfo('global.css')); echo '<hr>'; echo uuid(); ec 阅读全文
posted @ 2020-03-11 23:14 lujieting0 阅读(179) 评论(0) 推荐(0) 编辑
摘要:<?php //单个文件上传时的数组结构如下: $array = [ 'file' => [ 'name' => '', 'size' => '', 'error' => '', 'type' => '', 'tmp_name' => '', 阅读全文
posted @ 2020-03-11 23:13 lujieting0 阅读(224) 评论(0) 推荐(0) 编辑
摘要:<?php //计算任意两个数字之和 function sum($arg1,$arg2) { $sum = $arg1 + $arg2; return $sum; } $n = sum(3,5); //输出函数调用的结果 echo sum(3,5); $n = sum(2,1); //函数的结果作为 阅读全文
posted @ 2020-03-11 23:12 lujieting0 阅读(99) 评论(0) 推荐(0) 编辑
摘要:<?php //没有参数的自定义函数 function sum(){ for ($i = 0 ; $i <= 100; $i++){ $sum += $i; } echo $sum; } sum(); echo '中国'; sum(); ////////////////////////////// 阅读全文
posted @ 2020-03-11 23:11 lujieting0 阅读(237) 评论(0) 推荐(0) 编辑
摘要:<?php /** * 构建文件上传的基本信息 */ function builderInfo() { $index = 0; foreach ($_FILES as $item){ //多个 if (is_array($item['name'])){ foreach ($item['error'] 阅读全文
posted @ 2020-03-11 23:10 lujieting0 阅读(232) 评论(0) 推荐(0) 编辑
摘要:<?php /** * 产生UUID */ function uuid() { $uuiqId = md5(uuiqid(mt_rand() . microtiome())); $uuid = substr($uniqId, 0, 8) . '-' $uuid = substr($uniqId, 8 阅读全文
posted @ 2020-03-11 23:09 lujieting0 阅读(103) 评论(0) 推荐(0) 编辑
摘要:<?php /** * */ function insert($array, $table){ $fields = implode(',', array_key($array)); $values = "'" . implode("','", $array) . "'"; $sql = "INSER 阅读全文
posted @ 2020-03-11 23:08 lujieting0 阅读(159) 评论(0) 推荐(0) 编辑
摘要:<?php if (is_array($_FILES['file']['name'])){ foreach ($_FILES['file']['error'] as $key => $error){ if ($error == UPLOAD_ERR_OK){ //获取当前上传文件的名称(原始名称) 阅读全文
posted @ 2020-03-11 23:07 lujieting0 阅读(260) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document< 阅读全文
posted @ 2020-03-11 23:05 lujieting0 阅读(628) 评论(0) 推荐(0) 编辑
摘要:<?php echo $_POST['username']; echo $_POST['password']; //获取上传文件的名称 $filename = $_FILES['file']['name']; //获取上传文件的错误代码 $error = $_FILES['file']['error 阅读全文
posted @ 2020-03-11 23:02 lujieting0 阅读(271) 评论(0) 推荐(0) 编辑
摘要:<?php //$arr是一个关联数组,有5个成员 //name,sex,age,education,mobile $users = [ 'name' => ['张三','李四','王五','赵六'], 'sex' => ['男','女','女','男'], 'age' => [12,13,14,1 阅读全文
posted @ 2020-03-11 23:01 lujieting0 阅读(124) 评论(0) 推荐(0) 编辑
摘要:<?php $arr = [ ['张三','男','22'], ['李四','女','23'], ['王五','男','24'], ['赵六','女','25'], ]; //张三,男,22|李四,女,23|王五,男,24|赵六,女,25 foreach ($arr as $item){ $temp 阅读全文
posted @ 2020-03-11 22:59 lujieting0 阅读(128) 评论(0) 推荐(0) 编辑
摘要:<?php //包含了N多个人的基本信息(姓名、性别、年龄) $str = '张三,男,22|李四,女,23|王五,男,17'; /** * $arr = [ * ['张三','男',22]; * ['张三','男',22]; * ['张三','男',22]; * ]; * */ //转换成 $ar 阅读全文
posted @ 2020-03-11 22:57 lujieting0 阅读(849) 评论(0) 推荐(0) 编辑
摘要:<?php $products = [ ['id' => 1, 'productName' => '商品1', 'productsPrice' => 500, 'productImage' => 'a1.jpg'], ['id' => 2, 'productName' 阅读全文
posted @ 2020-03-11 22:56 lujieting0 阅读(210) 评论(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 阅读(116) 评论(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 阅读(229) 评论(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 阅读(151) 评论(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 阅读(99) 评论(0) 推荐(0) 编辑
摘要:<?php // 空值 // 声明但没有赋值 $username; var_dump($username); //声明但赋值为null $passwoed =null; var_dump($passwoed); //通过unset()函数销毁的变量 $age =19; unset($age);//销 阅读全文
posted @ 2020-03-11 22:30 lujieting0 阅读(104) 评论(0) 推荐(0) 编辑
摘要:<?php // 数组(一组相关数据的容器) $arr = ['Tom',26,'男',false,8000,'本科','河南省']; echo '姓名:',$arr[0],'<br>'; echo '年龄:',$arr[1],'<br>'; echo '学历:',$arr[5],'<br>'; 阅读全文
posted @ 2020-03-11 22:28 lujieting0 阅读(133) 评论(0) 推荐(0) 编辑
摘要:<?php // NowDOC案例 $title ='title'; $boby = '<h1>Hello world</h1>'; $html = <<<'EOT' <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8"> 阅读全文
posted @ 2020-03-11 22:25 lujieting0 阅读(93) 评论(0) 推荐(0) 编辑
摘要:<?php // 1.获取提交的数据 $username = $_POST['username']; $password = $_POST['password']; $password2 = $_POST['password2']; $email = $_POST['email']; $sex =  阅读全文
posted @ 2020-03-11 22:22 lujieting0 阅读(88) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv 阅读全文
posted @ 2020-03-11 22:21 lujieting0 阅读(481) 评论(0) 推荐(0) 编辑
摘要:<?php // 因为双引号内变量可以被解析,所以可通过花括号语法将变量名称括起来,以防止PHP引擎获取更多的字符; $username='Tom'; echo "<p>username is:{$username}s</p>"; echo "<p>username is:${username}s< 阅读全文
posted @ 2020-03-11 22:19 lujieting0 阅读(118) 评论(0) 推荐(0) 编辑
摘要:<?php //变量 $userId=5;//整型 $username="Tom" ;//字符型 $password='12345';//字符型(不参加数字运行的数字要归为字符型,如手机号、qq号等) $age=26;//整型 $sex=true;//布尔型(true表示男) $salary=789 阅读全文
posted @ 2020-03-11 22:17 lujieting0 阅读(81) 评论(0) 推荐(0) 编辑
摘要:<?php // HereDOC案例 $title ='title'; $boby = '<h1>Hello world</h1>'; $html = <<<CDATA <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8"> 阅读全文
posted @ 2020-03-11 22:04 lujieting0 阅读(65) 评论(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:02 lujieting0 阅读(138) 评论(0) 推荐(0) 编辑
摘要:1.什么是PHPPHP(hypertext preprocessor),超文本预处理器 2.PHP能做什么a.命令行脚本b.服务器脚本(最主要功能)c.桌面应用程序 3.PHP的工作原理a.客户端向服务器发送HTTP请求b.服务器接收请求后,将请求转发给PHP引擎c.PHP引擎接受并处理请求d.PH 阅读全文
posted @ 2020-03-11 21:59 lujieting0 阅读(251) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示