Aşağıda Bu kod diğer içine bir dosyadan iki değişken geçirebilirsiniz.
<?php
$file = 'somefile.txt';
// Open the file to get existing content
$current = fopen($file,'a');
// Append a new person to the file
$firstname .= "aiden\n";
$secondname .= "dawn\n";
$currentContent = file_get_contents($file);
// Write the contents back to the file
$fileFound = 'people.txt';
$newFile = fopen($fileFound,'a');
//if $current and $nextcurrent is found in the somefile.txt it will transfer the content to people.txt
if (strpos($currentContent,$firstname) !== 0)
{
if (strpos($currentContent,$secondname) !== 0)
{
fwrite($newFile, $currentContent."\n");
} // endif
}// endif
?>
The next problem is, how am i able to migrate the texts from identifier one up to identifiers two? I guess I'll have to use substr or a strrpos string here. Help Please :)