提问人:Jack Bender 提问时间:6/4/2023 最后编辑:Jack Bender 更新时间:6/4/2023 访问量:152
在 PHP 中将提取的 mp4 链接导出到新的 txt 文件
Exporting extracted mp4 links to a new txt file in PHP
问:
我有这个php代码,它从名为SSIPTVx.txt的txt文件中提取特定的mp4链接。
我的问题是:我如何将获得的结果导出到新的 txt 文件?
<?php
// Open txt file
$file = fopen("SSIPTVx.txt", "r");
// Read the content line by line
while(!feof($file)) {
$line = fgets($file);
// Find specific .mp4 links
preg_match_all('/(https?:\/\/(tream720\.xyz\/content\/|nvid101\.cdnii\.com\/|video\.videodomain\.icu\/)[^\s]+\.mp4)/', $line, $matches);
// Print found links
foreach($matches[0] as $match) {
echo $match . "<br>";
}
}
// Close txt file
fclose($file);
?>
我尝试为新的 txt 文件放置 fopen,但无法获得任何结果
答: 暂无答案
评论
file_get_contents
file_put_contents