//create an image 400 by 200 pixels $img = imagecreate(400,200); //set variable $red to be red $red = imagecolorallocate($img,255,0,0); //draw a rectangle Imagerectangle($img,50,50,150,150,$red); //create a gif ImageJPEG($img,"pic.jpg"); //clean up resources ImageDestroy($img); ?>
//declare an array $list = array("a","b","c","d","e"); //print the array print_r ($list); print " "; //reverse the array and print the array contents again print_r (array_reverse($list)); ?>