I have a PHP script that I wrote and worked well. The other day I made a few modifications and Firefox gave an error and said it reset the connection or something like that. I started to comment out the code to find the problem area and it was a fopen
I googled looking for the answer which I found a number of results. Someone posted this code which Incorporated into my code and that fixed my problem but it did not explain what was happening?
I looked at the PHP site for the description and it was only 1 sentence, "Creates and returns a stream context with any options supplied in options preset. "
I am still trying to understand what this function is doing which allowed my code to work. I am happy that it works but I want to know why so I understand it better.
Thanks
Code:
$fp_read = fopen($pathToFile, "w");
I googled looking for the answer which I found a number of results. Someone posted this code which Incorporated into my code and that fixed my problem but it did not explain what was happening?
Code:
$context = stream_context_create(array('ftp'=>array( 'overwrite' => true)));
$fp_read = fopen($pathToFile, "w", false, $context);
I looked at the PHP site for the description and it was only 1 sentence, "Creates and returns a stream context with any options supplied in options preset. "
I am still trying to understand what this function is doing which allowed my code to work. I am happy that it works but I want to know why so I understand it better.
Thanks