我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

将文本拆分为130个字符长的部分[关闭]

I need to split an up to 2000 characters long text into 130 character long parts to store every single one into a database.

How to split the text into 130 character parts?

Take a look at chunk_split() and wordwrap(). Combined with explode() you could get an array of 130 character lines.

$chunks = explode('##', chunk_split($string, 130, '##'));
print_r($chunks);

Note: I've chosen ## as a delimiter. This may need to be adjusted depending on your string.

近期文章

  • 如何从PHP获取价值并在javascript中使用
  • 将地址栏中的url设置为php中的用户名[复制]
  • PHP while循环不能在Bootstrap的modal中工作
  • mysql assoc错误
  • Mysql查询似乎不起作用
  • 我需要php Homework的帮助
  • php发布到电子邮件
  • PHP没有执行
  • 更改下拉列表/复选框选项
  • 搜索多个表格中的前三个字母
  • 正则表达式以读取特定HTML行<TD> PHP [重复]
  • 如何在php中使用正则表达式验证电话号码? [重复]
  • 在mysql中排序字母数字? [关闭]
  • 在函数外部使用查询值
  • 以js形式转换/发送日期[重复]
  • 在PHP中获取实际的URL HASH
  • 如何使用PHP和MySQL按字母顺序和数字方式获取数据?
  • $ _FILES中的子数组
  • Mysqli错误非对象[重复]
  • Opencart - 类别总是扩展

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华