If I display $d[0] it is liam.schnell@gmail.com but it is refusing to accept the if…
$d = file("mails.txt");
if ($d[0] == "liam.schnell@gmail.com") {
echo "JOW!";
}
echo $d[0];
Any idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try calling the trim function on the
$d[0], which will remove all new line characters at the beginning and end of the string.or not include any new lines at all:
From: http://php.net/manual/en/function.file.php