How can I capture a txt file's content to a variable??? For ex: i have a $message variable how can I send the inside of message.txt to this variable???
Try this:
$message=file("message.txt");
this puts the file message.txt into the array $message with each line of the file being an element and still having the newline attached.
HTH
Hi,
try following:
$message = join('', file('./message.txt'));
wizkid