zzl00770

导航

2025年12月8日 #

获取数组长度即最大下标

摘要: $xm = array('小明','男',28,5888.88); //count()函数用于返回数组长度(元素的个数),int(整型) $x = count($xm); echo $x; echo "<br>"; var_dump($x); //3.使用数组长度添加数据 $xm[count($xm 阅读全文

posted @ 2025-12-08 20:59 品味人生nuiapp 阅读(3) 评论(0) 推荐(0)

索引数组读取修改添加

摘要: 1 $xm = array('小明','男',28,5888.88); 2 3 //1.读取数据 4 echo $xm[0].'同学的工资是:'.$xm[3].'元人民币。'; 5 6 //2.修改数据 7 $xm[0] = '小张'; 8 $xm[1] = '女'; 9 $xm[2] = 18; 阅读全文

posted @ 2025-12-08 20:51 品味人生nuiapp 阅读(5) 评论(0) 推荐(0)

三种数组创建方法

摘要: //1.短数组语法创建,PHP5.4起开始使用 $yiban = ['张三','李四','王五','赵六']; //php索引数组 //2.使用array()创建 $yiban = array('张三','李四','王五','赵六'); //php索引数组 //3.直接赋值 创建数组 $yiban[ 阅读全文

posted @ 2025-12-08 20:47 品味人生nuiapp 阅读(7) 评论(0) 推荐(0)

2025年3月30日 #

fs文件模块命令

摘要: 创建文件夹 例如: 在D盘node文件夹下创建一个名为 MyFolder 的文件夹 首先使用 cd 命令导航到该目录 cd D:\node 然后输入命令 mkdir MyFolder 即可完成创建 新建文件 例如:创建一个index.js文件 touch index.js 阅读全文

posted @ 2025-03-30 21:33 品味人生nuiapp 阅读(12) 评论(0) 推荐(0)

2025年3月24日 #

fs模块 写入文章

摘要: 异步写入(fs.writeFile) 1.语法 fs.writeFile(file, data[, options], callback) 2.参数说明 file:要写入的文件路径。如果路径中没有该文件,则会创建一个文件;如果路径中有该文件,默认会重写文件中的内容。 data:待写入的数据,可以是字 阅读全文

posted @ 2025-03-24 20:57 品味人生nuiapp 阅读(34) 评论(0) 推荐(0)

2024年7月28日 #

判断arr数组里的元素是否存在{name:'张三'},

摘要: const arr = [ {name: '李四', name: '王五', name: '张三'}, {name: '李四', name: '王五', name: '张三'}, ]; const hasZhangSan = arr.some(item => item.name '张三'); con 阅读全文

posted @ 2024-07-28 07:01 品味人生nuiapp 阅读(22) 评论(0) 推荐(0)

2024年7月27日 #

将小数转换为整数

摘要: let num = 3.14; // 向下取整let floorNum = Math.floor(num); // 结果为 3console.log("向下取整:", floorNum); // 向上取整let ceilNum = Math.ceil(num); // 结果为 4console.lo 阅读全文

posted @ 2024-07-27 12:02 品味人生nuiapp 阅读(70) 评论(0) 推荐(0)

js 判断字符串是不是数字

摘要: function isNumeric(str) { return /^\d+$/.test(str); } // 使用示例 console.log(isNumeric("123")); // 输出: true console.log(isNumeric("abc")); // 输出: false 阅读全文

posted @ 2024-07-27 12:00 品味人生nuiapp 阅读(30) 评论(0) 推荐(0)

2024年1月26日 #

getskiplimit 跳过指定条数的数据 ,常用于分页

摘要: //云端代码 'use strict'; const db = uniCloud.database() exports.main = async (event, context) => { const collection = db.collection(event.name) const res 阅读全文

posted @ 2024-01-26 21:42 品味人生nuiapp 阅读(11) 评论(0) 推荐(0)

2024年1月24日 #

tabs 标签页

摘要: <scroll-view scroll-x="true" class="scroll-view-x" scroll-left="{{scrollleft}}" scroll-with-animation> <view class="scroll-view-item" wx:for="{{tabDat 阅读全文

posted @ 2024-01-24 20:45 品味人生nuiapp 阅读(21) 评论(0) 推荐(0)