Tim Mousel
Tue 11th Jul '00, 8:23am
Hi,
I've got a file that contains 7 digit numbers in this format:
1111111
2222222
3333333
3432993
I want to determine if a specific number is there and if so delete it from the file. For example, $pincode = "2222222";
Here's what I've got so far:
// Read the entire file into the variable $file_contents
$pinfilename = '/home/public_html/custom/php/data/pincode.txt';
$fp = fopen( $pinfilename, 'r' );
$file_contents = fread( $fp, filesize( $pinfilename ) );
fclose( $fp );
Now that it is an array, how do I determine if $pincode is present and how do I delete it?
Any help would be appreciated,
Tim
I've got a file that contains 7 digit numbers in this format:
1111111
2222222
3333333
3432993
I want to determine if a specific number is there and if so delete it from the file. For example, $pincode = "2222222";
Here's what I've got so far:
// Read the entire file into the variable $file_contents
$pinfilename = '/home/public_html/custom/php/data/pincode.txt';
$fp = fopen( $pinfilename, 'r' );
$file_contents = fread( $fp, filesize( $pinfilename ) );
fclose( $fp );
Now that it is an array, how do I determine if $pincode is present and how do I delete it?
Any help would be appreciated,
Tim