douzhong4222 2018-08-16 10:15
浏览 33
已采纳

PHP:在一行中添加非数字值到范围数组的开头

How can I add "Please choose" to the beginning of this array

$enDuration  =   range( 0 , 60);

Best would be it all happens in ONE line as it is for a language config file and should stay as clean as possible. Array_combine didn't work for me.

  • 写回答

5条回答 默认 最新

  • dtq26360 2018-08-16 10:19
    关注

    You can use array_merge, like this:

    $enDuration = array_merge(['Please choose'], range(0, 60));
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应