V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
neworld07
V2EX  ›  PHP

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

  •  
  •   neworld07 · 2016-09-07 18:54:03 +08:00 · 3006 次点击
    这是一个创建于 2781 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    4 条回复    2016-09-08 00:47:06 +08:00
    HugeNature
        1
    HugeNature  
       2016-09-07 19:53:31 +08:00
    1.txt
    2.txt
    3.txt
    rand(1,3)
    neworld07
        2
    neworld07  
    OP
       2016-09-07 22:09:52 +08:00
    @HugeNature 请教如何完整的写?可有偿!
    996635
        3
    996635  
       2016-09-08 00:27:11 +08:00
    具体看一下你的需求, 比较简单 可以联系我 q 26-2424-870
    aprikyblue
        4
    aprikyblue  
       2016-09-08 00:47:06 +08:00 via Android
    挺简单的啊,,
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   926 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 19:57 · PVG 03:57 · LAX 12:57 · JFK 15:57
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.