我想使用php进行自动递增,但当日期从01开始或我的表为空时,它的数字再次重新启动为1这是我的号码:
$day = date('t');
$month = date('n');
$years = date('Y');
$num = 001/$month/$years
我转换了一个数字
$cut = (int)substr($num,2,1);
然后当日期从01 开始时,我不知道如何增加数字并再次回到1
感谢您的回答,并花时间回答我的新手文章
尝试PHP explode
:-
<?php
$num = '001/$month/$years';
$num=explode("/",$num);
$cut = (int)$num[0];
echo ++$cut;
?>