hi everyone i have a problem with updating the text file
i want to add name at the end of a line and separate with semi colon,
can someone look at my code and help me out.
2004 (12 November 2004) name tumi; yale;
2004 (12 November 2004) name simon; tiro;
2004 (12 November 2004) name lebo; dud ;
[code=php]
<?php
$data =$_POST["name1"]." " .$_POST["name2"]."; ".$_POST["name3"]." \n";
$q=$_POST["path"];
$myArray = file($q."myfile .txt");
$fp = fopen($q."Regis try.txt", "w");
array_push($myA rray,$data);
usort($myArray, "strnatcmp" );
//Loop through the registry array
foreach ($myArray as $value)
{
//Write the sorted contents to registry line-by-line
fwrite($fp,$val ue);
}
// Close the registry file
fclose($fp);
?>
[/code]
i want to add name at the end of a line and separate with semi colon,
can someone look at my code and help me out.
2004 (12 November 2004) name tumi; yale;
2004 (12 November 2004) name simon; tiro;
2004 (12 November 2004) name lebo; dud ;
[code=php]
<?php
$data =$_POST["name1"]." " .$_POST["name2"]."; ".$_POST["name3"]." \n";
$q=$_POST["path"];
$myArray = file($q."myfile .txt");
$fp = fopen($q."Regis try.txt", "w");
array_push($myA rray,$data);
usort($myArray, "strnatcmp" );
//Loop through the registry array
foreach ($myArray as $value)
{
//Write the sorted contents to registry line-by-line
fwrite($fp,$val ue);
}
// Close the registry file
fclose($fp);
?>
[/code]
Comment