PHPʵÏÖÔ²½ÇͼƬ
¹¤×÷ÖÐÓõ½£¬×Ô¼ºÐ´ÁËÒ»¸ö£¬·ÖÏí¸øÓÐÐèÒªµÄÈË£¬Ç°ÃæÊÇÀඨÒ壬ºóÃæ2ÐÐÊǵ÷Óá£
Óŵ㣺
²»ÐèÒªÍⲿͼƬ
Ö§³ÖPNG͸Ã÷
¿É×Ô¶¨ÒåÔ²½Ç°ë¾¶
²»×㣺
Ö»ÄÜÖ¸¶¨Ò»ÖÖ͸Ã÷É«
<?php
class RoundedCorner {
private $_r;
private $_g;
private $_b;
private $_image_path;
private $_radius;
function __construct($image_path, $radius, $r = 255, $g = 0, $b = 0) {
$this->_image_path = $image_path;
$this->_radius = $radius;
$this->_r = (int)$r;
$this->_g = (int)$g;
$this->_b = (int)$b;
}
private function _get_lt_rounder_corner() {
$radius = $this->_radius;
$img = imagecreatetruecolor($radius, $radius);
$bgcolor = imagecolorallocate($img, $this->_r, $this->_g, $this->_b);
$fgcolor = imagecolorallocate($img, 0, 0, 0);
imagefill($img, 0, 0, $bgcolor);
imagefilledarc($img, $radius, $radius, $radius*2, $radius*2, 180, 270, $fgcolor, IMG_ARC_PIE);
imagecolortransparent($img, $fgcolor);
return $img;
}
private function _load_source_image() {
$ext = substr($this->_image_path, strrpos($this->_image_path, '.'));
if (empty($ext)) {
return false;
}
switch(strtolower($ext)) {
case '.jpg':
$img = @imagecreatefromjpeg($this->_image_path);
break;
case '.gif':
$img = @imagecreatefromgif($this->_image_path);
break;
case '.png':
$img = @imagecreatefrompng($this->_image_path);
break;
default:
return false;
}
return $img;
}
public function round_it() {
// load the source image
$src_image = $this->_load_source_image();
if ($src_image === false) {
die('Sorry, can\'t load the image');
}
$image_width = imagesx($src_image);
$image_height = imagesy($src_image);
// create a new image, with src_width, src_height, and fill it with transparent color
$image = imagecreatetruecolor($image_width, $image_height);
$trans_color = imagecolorallocate($image, $this->_r, $this->_g, $this->_b
Ïà¹ØÎĵµ£º
mysql½¨Á¢Ò»¸ö±í¸ñ£º
create table hyhtbsc(
id int(4) primary key auto_increment,
username varchar(20),
password varchar(20)
);
²éѯÊý¾Ý¿âÄÚÈÝ£º
<?php
$conn = mysql_connect("localhost","root","pass");
mysql_select_db("mydb",$conn);
$sql = "select * from mytable";
$result = mysql_query($ ......
Õâ¸öÊÇÓÉasp¶þ¼¶²àÀ²Ëµ¥¸ÄµÄ
<script language="javascript">
// JavaScript Document
startList = function() {
if (document.all && document.getElementById) {
navRoot = document.getElementById("nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.chil ......
ÒÔϹØÓڴ˺¯Êý¸÷ÏîʹÓòÎÊý:
bool curl_setopt (int ch, string option, mixed value)
curl_setopt()º¯Êý½«ÎªÒ»¸öCURL»á»°ÉèÖÃÑ¡Ïî¡£option²ÎÊýÊÇÄãÏëÒªµÄÉèÖã¬valueÊÇÕâ¸öÑ¡Ïî¸ø¶¨µÄÖµ¡£
ÏÂÁÐÑ¡ÏîµÄÖµ½«±»×÷Ϊ³¤ÕûÐÎʹÓÃ(ÔÚoption²ÎÊýÖÐÖ¸¶¨)£º
CURLOPT_INFILESIZE
: µ±ÄãÉÏ´«Ò»¸öÎļþµ½Ô¶³ÌÕ¾µã£¬Õâ¸öÑ¡Ï ......
һѡÔñÌ⣺
1.ÏÂÃæµÄÄǸöÑ¡Ïî¿ÉÒÔ»ñÈ¡±íµ¥Ìá½»µÄÖµ£¿£¨¶àÑ¡£© b d
<form name='frm1' method="post">
<input type="text" name="name" ><input type="submit" name="a">
</form>
A.$_GET['name']
B.$_POST['name']
C.$_SESSION['name']
D.$_REQUEST['name']
E.$_GLOBAL['name']
2.ÍüÀ²¡£ ......
¿ÉÒÔ¼òµ¥µÄÓÐÁ½¸öforÑ»·±íʾ ¾Å¾Å³Ë·¨±í,µ«ÊDz¢²»ÖªµÀÈçºÎ½øÐÐURLµÄÉèÖÃ.
<?php
for($a =1;$a<=9;$a++)
{
for($b =1;$b<=$a;$b++)
{$c =$a *$b;
echo "$a*$b=$c ";
}
echo "<p>";
}
?> ......