摘要: <?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 阅读(177) 评论(0) 推荐(0) 编辑
摘要: <?php //单个文件上传时的数组结构如下: $array = [ 'file' => [ 'name' => '', 'size' => '', 'error' => '', 'type' => '', 'tmp_name' => '', 阅读全文
posted @ 2020-03-11 23:13 lujieting0 阅读(220) 评论(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 阅读(227) 评论(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 阅读(102) 评论(0) 推荐(0) 编辑
摘要: <?php /** * */ function insert($array, $table){ $fields = implode(',', array_key($array)); $values = "'" . implode("','", $array) . "'"; $sql = "INSER 阅读全文
posted @ 2020-03-11 23:08 lujieting0 阅读(157) 评论(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 阅读(258) 评论(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 阅读(616) 评论(0) 推荐(0) 编辑
摘要: <?php echo $_POST['username']; echo $_POST['password']; //获取上传文件的名称 $filename = $_FILES['file']['name']; //获取上传文件的错误代码 $error = $_FILES['file']['error 阅读全文
posted @ 2020-03-11 23:02 lujieting0 阅读(268) 评论(0) 推荐(0) 编辑