After sending the string via the email i want to save it into file. so i do it this way:
file_put_contents("coupon.txt", $email. $RandomString , FILE_APPEND | LOCK_EX);
and in this way it's look like this:
[email protected]@email2.com1d2d5s4d51d
so no new line and no space between the codes. when i tray to use this way:
file_put_contents("coupon.txt", $email. . $RandomString .PHP_EOL. , FILE_APPEND | LOCK_EX);
it's just wont save anything, more then this is to error the mail sending.
Tal.
You need to append "\n", try this:
file_put_contents("coupon.txt", $email . " " . $RandomString . "\n" , FILE_APPEND | LOCK_EX);