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

too long

I have a string which contain contact numbers. For example,

$contactnumber='923216210221'

Now I want to separate starting 5 digits e.g. '92321' in a different variable and other digit e.g. '6210221' in a different variable.

Use substr PHP:

$partOne = substr($contactnumber, 0, 5);
$partTwo = substr($contactnumber, 6);
$partTwo = substr($contactnumber,5);

近期文章

  • PHP中的条件IF
  • PHP MySQLi没有更新
  • MYSQL DESC LIMIT变量
  • 致命错误:在资源[关闭]上调用成员函数fetch_assoc()
  • 根据具有特定值的%记录发送电子邮件
  • 如何在php中获取数组元素isMultiple
  • 当正斜杠选择数据时,Mysql错误1064.PHP [关闭]
  • php代码没有将值插入数据库
  • sql注入可能是下面的PHP代码吗?
  • 使用PHP文件的头函数? [关闭]
  • 全部小写并用 - 替换空格 -
  • 为什么我的mysql_fetch_array或mysql_fetch_assoc不起作用
  • 使用SESSIONS进行基本登录[关闭]
  • 用于生成地图的Google Map API [已关闭]
  • 使用php更改<li>元素的位置
  • 如何将json的输入编码为jquery ui自动完成? [关闭]
  • 如何将数组时间相加[关闭]
  • php如果$ _GET等于某个数组
  • PHP中的Groupon优惠券代码系统[关闭]
  • 修改php中的URL [关闭]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华