Re: [PHP] Writing Array to File w/o blank lines

2002-01-13 Thread Philip Olson
Hello Andrew- This can be solved here or better yet, solved from the place that removes the array elements. Use unset() for that: unset($arr[$key]); Now, when you loop through the array it'll have no empty elements. Rather then use for(), consider foreach() as it relies on no counts. But

[PHP] Writing Array to File w/o blank lines

2002-01-13 Thread Andrew V. Romero
I have been working on a script that manipulates arrays and now I am working on the part where the user can erase part of the array. Previously the function that writes the array to a file looked like: function updateSuspenderOrVehicleFile($fileToUpdate, $newDataArray) { $fileName = fopen( $file