$devices = array( 'iphone_p' => array( 'type' => 'iPhone: portrait (320x480)', 'width' => 320, 'height' => 480 ), 'iphone_l' => array( 'type' => 'iPhone: landscape (480x320)', 'width' => 480, 'height' => 320 ), 'moto' => array( 'type' => 'Motorola phone/browser (RAZR, v551, etc)', 'width' => 176, 'height' => 220 ), 'n80' => array( 'type' => 'Nokia N80 (N60WebKit)', 'width' => 352, 'height' => 416 ) ); if ( ! empty( $_REQUEST['w'] ) && ! empty( $_REQUEST['h'] ) && (int) $_REQUEST['w'] && (int) $_REQUEST['h'] ) { $custom_w = (int) $_REQUEST['w']; $custom_h = (int) $_REQUEST['h']; $choice = array( 'type' => "Custom size ({$custom_w}x{$custom_h})", 'width' => $custom_w, 'height' => $custom_h ); } elseif ( ! empty( $_REQUEST['d'] ) && ! empty( $devices[$_REQUEST['d']] ) ) $choice = $devices[$_REQUEST['d']]; else $choice = $devices['iphone_p']; ?>