How to delete text from a file using preg_replace() function in PHP?
preg_replace( $pattern, $replacement, $subject);
Parameters:
$pattern: It contains the string we have to replace.
$replacement: It contains the string that will replace the existing string.
$subject: It contains the main string file where need to remove the string.
We have created a text file named as fruits.txt
mango
apple
papaya
guava
apple
grapes
mango
apple
This program removes all the strings from the given file.
[mai mult...]


