【发布时间】:2012-07-01 14:54:57
【问题描述】:
如何在文档中找到一个字符串,然后回显该字符串?
例如,
文件:
blah blah result.php?whatiwanttoecho blah
或:
blahhh result.php?whatiwanttoecho blah blah blah
总会有'result.php?'在我想要回应之前。
我正在寻找的最终结果:
$doc = "./doc.txt";
$doccontents = file_get_contents($file);
然后是我需要帮助的代码,其最终结果为:
$result = 'whatiwanttoecho';
echo $result;
希望这是有道理的。谢谢(:
【问题讨论】:
标签: php string document file-get-contents