Disclaimer: I am not buying one of these but the topic came up in discussion with the eldest child.

The latest iPhones are out and the numbers for me to switch to a contract continue to be a no brainer. Buying the phone outright upfront is the only sensible thing saving anywhere from £233 to £1,079 over the typical 24-month contracts. Interesting to note that O2 has shot into the lead as most expensive. Virgin is the cheapest. Interesting to note that there are no “unlimited” data deals any more.

Contract Phone Cost Monthly Cost Months 2-yr TOTAL Extra Cost Data Minutes Texts
3 PAYG £799 £15.00 24 £1,159 £0 Unlimited 200 Unlimited
Virgin £0 £58.00 24 £1,392 £233 40GB 5000 Unlimited
3 £79 £70.00 24 £1,759 £600 100GB Unlimited Unlimited
EE £10 £73.00 24 £1,762 £603 100GB Unlimited Unlimited
Vodafone £30 £76.00 24 £1,854 £695 60GB Unlimited Unlimited
O2 £30 £92.00 24 £2,238 £1,079 50GB Unlimited Unlimited

My Three.co.uk PAYG £15 I have had for many years back to when the iPhone 5 came out. Your PAYG mileage may vary. I do not make that many calls so 200 minutes for me is fine. YMMV.

So, as every, do your research, choose wisely, don’t just get another contract unless you really have no other option.

It’s taken me 5-hours of effort over the last day or two to get my webcam correctly reporting a picture for my weather station.

Problem:  The Wunderground FTP process has stopped working with no sign of a resolution. I needed to provide a single image that could be referenced by Wunderground rather than FTP to their site. The trouble was that my webcam uses incremental filenames based on date-timestamp. I also needed to use the latest and get rid of any other uploads.

Solution: Use the PHP code that runs my weather page and forwards the weather station page to Wunderground to, in addition, find the latest image file and after 5-minutes rename it to the static name image file and delete all the other potentially uploaded webcam files.

It took a lot of trial and error to get to the code below. All the while reading the online PHP reference and other PHP examples to get to what I needed. It’s not necessarily petty code but it does work.

<?php
// list the ARG*.jpg files in the webcam directory. Save to an array
$ARCfiles = glob('../webcam/ARC*.jpg');
// reverse sort the array to get the most recent file by timestamped name
rsort ($ARCfiles);
// grab the first (most recent file)
$fileselected = $ARCfiles[0];
// setup the logging file and write the selected file to the logging file
// $latestfile = '../webcam/latestwebcamfile.txt';
// file_put_contents($latestfile, $fileselected);
// check that the webcam image is 5-minutes old. If so overwrite it with the latest and delete all other ARC*.jpg files.
if(file_exists('../webcam/webcamimage.jpg')&&time()- filectime('../webcam/webcamimage.jpg')>300){   
   rename($fileselected , '../webcam/webcamimage.jpg');   
   // list then delete every file beginning with ARC*   
   $files = glob('../webcam/ARC*.jpg');  
   foreach($files as $file){ 
      if(is_file($file)){ 
         unlink($file); 
      }   
   }
}
?>