Тема: Convert a resource to a string in php 2

Hi,

I posted a few minutes ago a question regarding the convertion of a resource into a string in php. I did create a working example using mail function and one of the mods flag it as a spam tool. Here is another example to solve this question without been a spam tool.

Here is the code:

<?php
$file = fopen("sites.txt","r");

while(! feof($file))
  {
  echo file_get_contents("http://127.0.0.1/index.php?url=$file");
  echo fgets($file). "<br>";
  }

fclose($file);
?>

Thanks

Buy Threads, Replies, Reactions, Signatures, etc - http://electrify.atspace.eu/shop/

2

Re: Convert a resource to a string in php 2

No answer, really?

Buy Threads, Replies, Reactions, Signatures, etc - http://electrify.atspace.eu/shop/

3

Re: Convert a resource to a string in php 2

1. This is Ukrainian forum. Sometimes we help others, but not too much.
2. Explain, what's your problem with this code. If it does what it should, what's the question? If it doesn't, then how we can understand what is it meant to do without you explanations? What URL do you want to open with file_get_contents?

4 Востаннє редагувалося privateloader (10.10.2018 11:33:58)

Re: Convert a resource to a string in php 2

Hi, Thanks. Since i didn't got a response here i posted on another forum and got the answer.

Example to help anyone that reads this thread looking for a similar response

  $sites = fgets($file);
  echo file_get_contents("http://127.0.0.1:81/index.php?url=$sites");

Add the first line to the loop and change $file in the second line which is a resource to the string $sites

Buy Threads, Replies, Reactions, Signatures, etc - http://electrify.atspace.eu/shop/