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

检查++是否存在,如果不存在,则得到最近的

[     number      -      title     ]
[        1        -        t1      ]
[        2        -        t2      ]
[        5        -        t3      ]
[       13        -        t4      ]
[       22        -        t5      ]

for this part $next_post = $number+1; each time i click for example on a button, Go a step forward, But when it reaches $number = 2; it will give me 404 error since there is no $number = 3; How am i supposed to type a query to check if the next number doesn't exist, And then jump directly to the nearest number.

Put your numbers in an array:

$numbers = [1, 2, 5, 13, 22];

Now you can use $next_post = $number[$i + 1];

近期文章

  • 递归求树上一共有多少个桃子(python )
  • redis整合springboot
  • 有没有人给我讲讲这一题该怎么写?
  • 深入研究 SSD固态 - 闪存
  • 有没有人能看懂这个算法呀
  • solidworks二次开发
  • MFC保存曲线坐标数据用什么方式比较好
  • 如何解决使用vscode创建的智能聊天项目在本地运行只显示静态页不能聊天,但在网上运行正常可以聊天
  • 怎么把函数接收的元素保存到列表中
  • 使用AJAX加载Bootstrap选择器
  • matlab周期冲激信号的频谱图(信号与系统)
  • mfc如何通过树控件显示各种文件图标
  • c语言while循环语句
  • 关于Mysql数据库的实现,我完成了一部分就buhui了
  • Blender `Generate Rig` 按钮是灰色的
  • 如何计算这个程序的数值
  • 代理服务器部署设置问题
  • 试图调用preg_replace中的函数
  • chi2算法数据离散化出现错误,如何解决?
  • 关于Group By 问题

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华