guoaibing 大佬有话说 : 2019-12-21 13:16:18
请教php大佬 生成结果保存为txt
用了以下代码调用Wordpress最新10篇文章
<?php
// Include WordPress
define(‘WP_USE_THEMES’, false);
require(‘wp-load.php’);
query_posts(‘showposts=10’);
?>
<?php while (have_posts()): the_post(); ?>
<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>
<?php endwhile; ?>
能否直接将生成后的结果保存为txt啊,直接用file_get_contents获取前端内容实在是搞不定,所以想在后端生成txt后,再通过file_get_contents获取txt内容
复世姬凌 大佬有话说 : 2019-12-21 13:54:50
百度一分钟,论坛半天吹牛打屁
hanada 大佬有话说 : 2019-12-21 13:32:30
file_put_contents
guoaibing 大佬有话说 : 2019-12-21 14:21:30
hanada 大佬有话说 : 2019-12-21 13:32
file_put_contents
多谢大佬我试试