Writing array to file w/o blanks- Update

From: Date: Mon, 14 Jan 2002 00:51:49 +0000
Subject: Writing array to file w/o blanks- Update
Groups: php.general 
Request: Send a blank email to php-general+get-80427@lists.php.net to get a copy of this message
Oops the function had one mistake in it (from me already trouble shooting this), it should be: function updateSuspenderOrVehicleFile($fileToUpdate, $newDataArray) { $fileName = fopen( $fileToUpdate,"w"); for ($i=0; $i<count($newDataArray); $i++) { //don't write blanks left by remove feature if ($newDataArray[$i] != "") { //check to see if on the last solution, if not add line break at end. if ($i+1 == count($newDataArray)) //the older email had an OR statement here fwrite($fileName,"$newDataArray[$i]"); else fwrite($fileName,"$newDataArray[$i]\r\n"); } } } Thanks, Andrew V. Romero

« previous php.general (#80427) next »