Is there an equivalent to PERL’s TIE in php? I’d like to see if a string(single word) is in a file where each line is a single word/string. If it is, I’d like to remove the entry. This would be very easy to do in Perl but unsure how I would do this in PHP.
Share
Depending on how you read the file will determine how you remove the entry.
Using
fgets:Using
file_get_contents:Using
file:Note: Each method assumes that you want to remove the entire entry if it contains a single word.