루프 어디서도이에 시작하는 완전히 의아해 해요,하지만 난 목록 B에 이들과 함께PHP와 함께 두 개의 텍스트 파일을 결합 - foreach는이
을 같은 파일 A에 키워드 목록을 제공 할 필요가
파일 A : :
1 호선
2 호선
세 번째 줄
에서 foreach는 라인의 라인을 추가 할
파일 B :
TEST1
TEST2
TEST3
combined.txt 파일로 출력 :
line1test1
line2test1
line3test1
line1test2 ... 그래서
<?php
$file1 = 'keywords.txt';
$file2 = 'topics.txt';
$combined = 'combined.txt';
$keywords = fopen("keywords.txt", "rb");
$topics = fopen("topics.txt", "rb");
$front = explode($topics);
$back = explode($topics);
while (!feof($keywords)) {
file_put_contents($combined, . $front ."". $back . "\n");
fclose($keywords & $topics);
}
?>
적어도 시도한 것을 증명하는 코드 샘플을 제공해야합니다. – jeremyjjbrown