neworld07
V2EX  ›  PHP

php 随机读取指定 txt 内容。模板调用标签

  •  
  •   neworld07 · Sep 7, 2016 · 3877 views
    This topic created in 3575 days ago, the information mentioned may be changed or developed.

    php 读取一个目录下的 txt 文件。 然后程序调用 template 目录下的 html 模板文件 在模板文件中插入<duanzi> 随机读取 1-2 行在首页输出。 问下各位该如何写?

    4 replies    2016-09-08 00:47:06 +08:00
    HugeNature
        1
    HugeNature  
       Sep 7, 2016
    1.txt
    2.txt
    3.txt
    rand(1,3)
    neworld07
        2
    neworld07  
    OP
       Sep 7, 2016
    @HugeNature 请教如何完整的写?可有偿!
    996635
        3
    996635  
       Sep 8, 2016
    具体看一下你的需求, 比较简单 可以联系我 q 26-2424-870
    aprikyblue
        4
    aprikyblue  
       Sep 8, 2016 via Android
    挺简单的啊,,
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   897 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 21:01 · PVG 05:01 · LAX 14:01 · JFK 17:01
    ♥ Do have faith in what you're doing.