Convert a php resource to a string
Posted: Sat Oct 06, 2018 10:38 am
Hi,
I was creating this little program to help me out sending emails but there is a issue i can't solve.
Convert a resource to a string
$file returns Resource id #3 instead of the value of the string
Here is a code example:
Thanks
I was creating this little program to help me out sending emails but there is a issue i can't solve.
Convert a resource to a string
$file returns Resource id #3 instead of the value of the string
Here is a code example:
Code: Select all
<?php
$file = fopen("emails.txt","r");
while(! feof($file))
{
mail($file, 'Thanks for joining!', Hi\nWe are glad to see you onboard\n\nPrivateloader);
echo fgets($file). " - just received a email.<br>";
}
fclose($file);
?>