PHP File Operation -
i trying create text file php in fopen("test.txt","a")
. have tried fopen("test.txt","w+")
.
the text file created want check string in test.text, exist or in test.txt not create duplicate entry. can me out?
use code:
$content = file_get_contents('test.txt'); if (str_pos('your keyword', $content) !== false){ // keyword exists in file }
Comments
Post a Comment