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

PHP生成固定字符串

I have a website that needs to generate a fixed prefixed strings and the order id as the invoice number.

The current code is $cnt = strlen($order->id);
$remain = 20-$cnt;
$data['invoiceNo'] = $this->generateRandomString($remain).$order->id;

How to i change it to have a prefix of JGJEPOSONLINECS + order id instead of random string + order id

Try with this code

$data['invoiceNo'] = 'JGJEPOSONLINECS'.$order->id ;

近期文章

  • PHP错误:预期不同的插入
  • laravel生产准备好了吗? [关闭]
  • 显示没有页面刷新的docx
  • PHP在Array中插入值(字母键)
  • 传递值时出现语法错误[关闭]
  • 我如何解码JSON.stringify中的数据
  • 在php中为给定范围生成数字
  • 生成1到100万之间的语法错误[关闭]
  • 如何将这个PHP代码转换为ruby(RoR)代码? [关闭]
  • 使用PHP生成HTML表[关闭]
  • 将PHP变量从.php传递到.js
  • Auth :: id()做什么?
  • php正则表达式为js正则表达式
  • PHP - Oracle正则表达式[关闭]
  • 单击数组中的每个ID
  • 将C#Snippet转换为PHP
  • OUTPUT单独从数组中键入1个键
  • 使用php生成Laravel密码
  • 在线添加Symfony 3.2网站上的捆绑包
  • 如何将JS值传递给PHP参数[重复]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华