PHP循环获取Excel表头字母A-Z,当超过时输出AA,AB,AC,AD······

news2024/11/25 11:48:49

PHP循环获取Excel表头字母A-Z,当超过时输出AA,AB,AC,AD······

PHP循环生成Excel的列字母表

$count_num = 26 * 27;
$letter = 'A';
$arr = [];
while($count_num--){
    $arr[] = $letter;
    $letter++;
}

结果如下:
请添加图片描述
转为JSON更为直观:

["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AK","AL","AM","AN","AO","AP","AQ","AR","AS","AT","AU","AV","AW","AX","AY","AZ","BA","BB","BC","BD","BE","BF","BG","BH","BI","BJ","BK","BL","BM","BN","BO","BP","BQ","BR","BS","BT","BU","BV","BW","BX","BY","BZ","CA","CB","CC","CD","CE","CF","CG","CH","CI","CJ","CK","CL","CM","CN","CO","CP","CQ","CR","CS","CT","CU","CV","CW","CX","CY","CZ","DA","DB","DC","DD","DE","DF","DG","DH","DI","DJ","DK","DL","DM","DN","DO","DP","DQ","DR","DS","DT","DU","DV","DW","DX","DY","DZ","EA","EB","EC","ED","EE","EF","EG","EH","EI","EJ","EK","EL","EM","EN","EO","EP","EQ","ER","ES","ET","EU","EV","EW","EX","EY","EZ","FA","FB","FC","FD","FE","FF","FG","FH","FI","FJ","FK","FL","FM","FN","FO","FP","FQ","FR","FS","FT","FU","FV","FW","FX","FY","FZ","GA","GB","GC","GD","GE","GF","GG","GH","GI","GJ","GK","GL","GM","GN","GO","GP","GQ","GR","GS","GT","GU","GV","GW","GX","GY","GZ","HA","HB","HC","HD","HE","HF","HG","HH","HI","HJ","HK","HL","HM","HN","HO","HP","HQ","HR","HS","HT","HU","HV","HW","HX","HY","HZ","IA","IB","IC","ID","IE","IF","IG","IH","II","IJ","IK","IL","IM","IN","IO","IP","IQ","IR","IS","IT","IU","IV","IW","IX","IY","IZ","JA","JB","JC","JD","JE","JF","JG","JH","JI","JJ","JK","JL","JM","JN","JO","JP","JQ","JR","JS","JT","JU","JV","JW","JX","JY","JZ","KA","KB","KC","KD","KE","KF","KG","KH","KI","KJ","KK","KL","KM","KN","KO","KP","KQ","KR","KS","KT","KU","KV","KW","KX","KY","KZ","LA","LB","LC","LD","LE","LF","LG","LH","LI","LJ","LK","LL","LM","LN","LO","LP","LQ","LR","LS","LT","LU","LV","LW","LX","LY","LZ","MA","MB","MC","MD","ME","MF","MG","MH","MI","MJ","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NB","NC","ND","NE","NF","NG","NH","NI","NJ","NK","NL","NM","NN","NO","NP","NQ","NR","NS","NT","NU","NV","NW","NX","NY","NZ","OA","OB","OC","OD","OE","OF","OG","OH","OI","OJ","OK","OL","OM","ON","OO","OP","OQ","OR","OS","OT","OU","OV","OW","OX","OY","OZ","PA","PB","PC","PD","PE","PF","PG","PH","PI","PJ","PK","PL","PM","PN","PO","PP","PQ","PR","PS","PT","PU","PV","PW","PX","PY","PZ","QA","QB","QC","QD","QE","QF","QG","QH","QI","QJ","QK","QL","QM","QN","QO","QP","QQ","QR","QS","QT","QU","QV","QW","QX","QY","QZ","RA","RB","RC","RD","RE","RF","RG","RH","RI","RJ","RK","RL","RM","RN","RO","RP","RQ","RR","RS","RT","RU","RV","RW","RX","RY","RZ","SA","SB","SC","SD","SE","SF","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SP","SQ","SR","SS","ST","SU","SV","SW","SX","SY","SZ","TA","TB","TC","TD","TE","TF","TG","TH","TI","TJ","TK","TL","TM","TN","TO","TP","TQ","TR","TS","TT","TU","TV","TW","TX","TY","TZ","UA","UB","UC","UD","UE","UF","UG","UH","UI","UJ","UK","UL","UM","UN","UO","UP","UQ","UR","US","UT","UU","UV","UW","UX","UY","UZ","VA","VB","VC","VD","VE","VF","VG","VH","VI","VJ","VK","VL","VM","VN","VO","VP","VQ","VR","VS","VT","VU","VV","VW","VX","VY","VZ","WA","WB","WC","WD","WE","WF","WG","WH","WI","WJ","WK","WL","WM","WN","WO","WP","WQ","WR","WS","WT","WU","WV","WW","WX","WY","WZ","XA","XB","XC","XD","XE","XF","XG","XH","XI","XJ","XK","XL","XM","XN","XO","XP","XQ","XR","XS","XT","XU","XV","XW","XX","XY","XZ","YA","YB","YC","YD","YE","YF","YG","YH","YI","YJ","YK","YL","YM","YN","YO","YP","YQ","YR","YS","YT","YU","YV","YW","YX","YY","YZ","ZA","ZB","ZC","ZD","ZE","ZF","ZG","ZH","ZI","ZJ","ZK","ZL","ZM","ZN","ZO","ZP","ZQ","ZR","ZS","ZT","ZU","ZV","ZW","ZX","ZY","ZZ"]

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1043038.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

MySQL 8 0 填坑历险之安装与基本用户权限

MySQL 8.0 填坑历险之安装 MySQL 是当下流行的关系型数据库,搜掠了各种文章,多少有些偏差,为此来分享下我的经历; 安装环境 环境版本备注Ubuntu 18.0418.04.6 LTS (Bionic Beaver)LinuxKernel5.4.0-42-genericMySQL 8.0.23mysq…

上海亚商投顾:沪指震荡调整 减肥药、华为概念股持续活跃

上海亚商投顾前言:无惧大盘涨跌,解密龙虎榜资金,跟踪一线游资和机构资金动向,识别短期热点和强势个股。 一.市场情绪 三大指数昨日震荡调整,上证50午后一度跌近1%,券商、保险等权重板块走势低迷。 华为概…

大咖共探AGI时代机遇,腾讯云助力大模型规模化应用提速

引言 2023 年,科技圈的“顶流”莫过于大模型。自 ChatGPT 的问世拉开大模型与生成式 AI 产业的发展序幕后,国内大模型快速跟进,已完成从技术到产品、再到商业的阶段跨越,并深入垂直行业领域。 新技术的爆发,催生新的应…

唤醒手腕 2023年 B 站课程 Golang 语言详细教程笔记(更新中)

0001、1000集GO语言Flag毒誓 唤醒手腕UP猪Pig目标花费1000集进行讲解Go语言视频学习教程(有趣的灵魂,适合小白,不适合巨佬),从2023年3月19日开始,将会一直每天更新,准备在2024年5月1日之前更新…

(主)9.26锁存器状态机方法、题解大综合(加码加码加码)

触发器 D D锁存器就是在有时钟信号时,D信号是啥,Q就是啥,并且在时钟信号消失时,锁存住消失前一刻的信号状态 主从D锁存器中,D信号是主锁存器的输入信号,主锁存器的信号是从锁存器的输入信号 用D实现的电…

苹果电脑专业的条形码工具iBarcoder:助力高效条形码生成,提升工作效率

iBarcoder for mac是Mac os平台上的一款优秀条码生成软件。它可以帮助用户建立不同类型的条形码,并允许用户设计并打印自己的条码标签,创建条码图形的零售包装、书籍、贴纸等。 在iBarcoder中,用户可以方便地创建专业的条形码标签&#xff0…

Linux服务器安装Anaconda 配置远程jupyter lab使用虚拟环境

参考的博客: Linux服务器安装Anaconda 并配置远程jupyter lab anaconda配置远程访问jupyter,并创建虚拟环境 理解和创建:Anaconda、Jupyterlab、虚拟环境、Kernel 下边是正文了。 https://www.anaconda.com/download是官网网址,可…

C/C++进程线程超详细详解

目录 前言 一、进程基础 1.进程概念 2.进程特征 3.进程状态(如图清晰可见) 4,进程的标识 实例代码如下: 5.进程的种类 实例shell脚本程序如下: 二、进程API 1.创建子进程 实例代码如下: 2.exec函数族 函数…

ptmalloc源码分析 - free()函数的实现(10)

目录 一、步骤1-标记MMAP分配的使用munmap_chunk释放 二、步骤2-释放的是小块内存,则chunk放入fastbin 三、步骤3-如果不是MMAP分配,则释放到unsorted bins 四、步骤4-如果nextchunk 就是Top chunk,则直接扩容Top chunk 五、步骤5-如果释…

分享从零开始学习网络设备配置--任务4.1 IPv6地址的基本配置

任务描述 某公司构建了互联互通的办公网,需要不断扩大网络规模。网络管理员小赵决定采用IPv6的地址,满足公司网络规模的未来发展。 由于IPv4地址耗尽及IPv4地址区域分配不均衡,成为运营商必须面临的一个问题。另外随着互联网的商业化&#…

【python】将python脚本打包成可执行的.exe文件 推荐使用auto-py-to-exe

将python脚本打包成可执行的exe文件 1.不推荐使用网上流行的打包程序,主要是有以下几点,一、cx_freeze与Pyinstaller都是命令行的形 式,且对于Pyinstaller的打包常常需要打包完成后,再修改打包后的原路径,二、非可视…

vue wangEditor富文本编辑器 默认显示与自定义工具栏配置

1.vue 显示wangEditor富文本编辑器 <template><div style"border: 1px solid #ccc;"><Toolbar style"border-bottom: 1px solid #ccc" :editor"editor" :defaultConfig"toolbarConfig" :mode"mode"/><…

Vue-diff算法和双向数据绑定原理

Vue–diff算法 我们提到了vue–diff算法之前先说一下关于vue的编译过程 一、Vue的编译过程主要分为以下的几个步骤&#xff1a; 1&#xff0c;解析模板&#xff1a;Vue会将模板解析语法树AST&#xff0c;并且对其中的指令和元素进行标记。 2&#xff0c;优化静态内容&#…

VUE的基本使用——hello,vue

一、准备一个容器root 二、创建一个Vue实例 三、配置容器 四、配置数据 五、将数据渲染到容器中 总结 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF-8"><meta name"viewport" content"widthde…

【挑战开发100个项目 | 1. C语言学生管理系统】

本项目是一个简易的学生信息管理系统&#xff0c;用户可以通过命令行界面完成学生信息的增加、删除、修改、查询、排序和列表展示等功能。数据以txt文件形式存储&#xff0c;实现了数据持久化。项目采用模块化设计&#xff0c;具有较好的可读性和扩展性。 一&#xff0c;开发环…

服装租赁小程序商城的作用是什么

如毕业礼服、演出服、场景拍照服、拍戏拍段子等很多人并不会直接全价购买&#xff0c;由于穿着次数少&#xff0c;所以服装租赁在市场中的需求也不少。 但传统线下服装租赁商家也很难拓展到客户&#xff0c;而需求者也无法快速触达到商家&#xff0c;线上经营没有自己的平台&a…

自学WEB后端03-Node.js 语法

学习后端路线&#xff1a; JavaScript 基础语法 Node,js 内置 API 模块 (fs、 path、 http等) 第三方 API 模块 (express、mysql等) 今天主要回顾下Node.js 语法 Node.js 是基于 Chrome V8 引擎的 JavaScript 运行环境&#xff0c;它提供了一种能够在服务器端运行 JavaScr…

如何使用php提取文章中的关键词?PHP使用Analysis中英文分词提取关键词

1、下载Analysis&#xff0c;创建test.php测试 2、引入Analysis实现中文分词 <?php include "./Analysis/Analysis.php";$annew \WordAnalysis\Analysis(); $content"机器学习是一门重要的技术&#xff0c;可以用于数据分析和模式识别。"; //10分词数…

Python3操作MySQL8.XX创建表|CRUD基本操作

Python3操作MySQL8.XX创建表|CRUD基本操作 Python3操作SQLite3创建表主键自增长|CRUD基本操作 一&#xff1a; Python3操作Mysql数据库建表 import pymysqlPython3操作Mysql创建表&#xff1a; # 打开数据库连接 db pymysql.connect(host"localhost", user"您…

R语言绘制环状柱状堆积图+分组+显著性

无叠加、显著性的代码&#xff1a; #设置工作环境 rm(listls()) setwd("D:/Desktop/0000/code-main/条形图")#加载R包 library(ggplot2) # Create Elegant Data Visualisations Using the Grammar of Graphics library(tidyverse) # Easily Install and Load the Ti…