【发布时间】:2009-11-11 19:27:55
【问题描述】:
不知道这叫什么,但有没有办法可以从文件中提取数据,回显它,但忽略特定字符集中的数据?
<?php
echo file_get_contents('test.txt');
?>
当我回显最终函数时,是否可以忽略星号之间的数据以及星号本身?
【问题讨论】:
标签: php function preg-match echo file-get-contents
不知道这叫什么,但有没有办法可以从文件中提取数据,回显它,但忽略特定字符集中的数据?
<?php
echo file_get_contents('test.txt');
?>
当我回显最终函数时,是否可以忽略星号之间的数据以及星号本身?
【问题讨论】:
标签: php function preg-match echo file-get-contents
你不会像“什么都没有”那样“忽略它”
一种快速的“n”脏方法
echo preg_replace( "/\*{3}.*?\*{3}/", "", file_get_contents( 'test.txt' ) );
【讨论】:
"this *** some text *** is a *** other text *** test"