Adding sleep () or some delay will give fopen time to retrieve the file from the location ... I suppose that the "random" effect may be traffic on the network, which leads to the fact that the search is a little longer than usual.
You can try using cURL to retrieve data:
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.domain.do/info.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch);
$output will contain the contents of the file, so you need to split the string into an array, possibly using a new string as a separator ... only fortunetelling does not know the contents of the file :)
Brian source share