全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 630|回复: 3

[疑问] 请教php大佬 生成结果保存为txt

[复制链接]
发表于 2019-12-21 13:16:18 | 显示全部楼层 |阅读模式
用了以下代码调用Wordpress最新10篇文章

  1. <?php
  2. // Include WordPress
  3. define('WP_USE_THEMES', false);
  4. require('wp-load.php');
  5. query_posts('showposts=10');
  6. ?>
  7. <?php while (have_posts()): the_post(); ?>
  8. <li><a href="<?php the_permalink(); ?>" target="_blank"><?php echo mb_strimwidth(strip_tags(apply_filters('the_title', $post->post_title)), 0, 50," "); ?></a></li>
  9. <?php endwhile; ?>
复制代码


能否直接将生成后的结果保存为txt啊,直接用file_get_contents获取前端内容实在是搞不定,所以想在后端生成txt后,再通过file_get_contents获取txt内容
发表于 2019-12-21 13:54:50 | 显示全部楼层
百度一分钟,论坛半天吹牛打屁
发表于 2019-12-21 13:32:30 来自手机 | 显示全部楼层
file_put_contents
 楼主| 发表于 2019-12-21 14:21:30 来自手机 | 显示全部楼层
hanada 发表于 2019-12-21 13:32
file_put_contents

多谢大佬  我试试
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-10 17:57 , Processed in 0.064610 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表