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

替换用逗号分隔的字符串

Is there any way to change or convert a strings/int that are separated with commas?

Example :

$str = "121,232,343,454";

should result into :

str1, str1, str1, str1

Depending on the language you are using, this is often the split($str, ',') or split(',', $str) or $str.split(',') function

split() is deprecated !!! Please use explode($seperator, $string) instead.

$str = "a,b,c";
$items = explode(',', $str);

近期文章

  • 在javascript中访问codeigniter会话变量[关闭]
  • 任何人都可以将此代码分解为可修改的格式[关闭]
  • 如何通过Php / MySQL发送大量(10,000+)以上的电子邮件? [关闭]
  • 如何将php数组与对象转换为简单数组?
  • 获得函数声明的“语法错误,意外”,“”
  • 如何在html或php页面请求时安装dll [关闭]
  • 如何检查是否有符号 - 在PHP中出现正则表达式?
  • 用于采样和销售歌曲的PHP / JavaScript MP3播放器[关闭]
  • 在PHP [重复]中从YY-MM-DD转换为MM-DD-YY
  • 警告:我使用标题时在php中的消息('Location:index.php)? [重复]
  • Php gearman文件上传[关闭]
  • 你可以通过将值赋给它的引用[关闭]来为PHP对象注入一个值吗?
  • 为什么PHP无法进入本地存储?
  • 用户在查看前必须喜欢页面
  • 它只显示一个文件名
  • 我在第23行找不到错误的代码[关闭]
  • 如何解析和显示评论
  • 如何在php中默认选中复选框[关闭]
  • 图像源中没有工作的URL [关闭]
  • 同步和排序两个数组[关闭]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华