views:

32

answers:

1

I am making an image morphing function, however I am encountering problems. I have an unexpected T_STRING at the commented line, which I'm sure is an embarrassingly simple error...

What's wrong? How can I avoid this in the future? Thanks.

 function morph($img) {
  $tempImg = $img;
  $size = getimagesize($tempImg);
  $width = $size[0];
  $height = $size[1];

  //Create the image background
  imagefilledrectangle($tempImg, 0, 0, $width, $height, imagecolorallocate($tempImg, 0, 0, 0)); //ERROR, unexpectued T_STRING
  return $tempImg;
 }
+5  A: 

You are missing a semicolon. Should be

$height = $size[1];
Gordon
+1 (Beat me by 15 seconds)...
ircmaxell