Thursday, February 10, 2011

How to fix gd-jpeg, libjpeg: recoverable error: Premature end of JPEG file

Sometimes php will through a error when using the imagecreatefromjpeg() for some jpge images saved by cameras and photo editing softwares. When I search the internet for a solution I found this great article which fix the problem http://worcesterwideweb.com/2008/03/17/php-5-and-imagecreatefromjpeg-recoverable-error-premature-end-of-jpeg-file/

Thursday, January 13, 2011

How to loop A-Z in php

Just like counting numbers :)

$letter = "A";
for($i = 1; $i<= 26; $i++)
{
  $letter++;
  echo $letter;
}