Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

PHP·À×¢Èë·ÖÎö

ÔÚÏÖÔÚ¸÷ÖֺڿͺáÐеÄʱºò£¬ÈçºÎʵÏÖ×Ô¼ºphp´úÂ밲ȫ£¬±£Ö¤³ÌÐòºÍ·þÎñÆ÷µÄ°²È«ÊÇÒ»¸öºÜÖØÒªµÄÎÊÌ⣬ÎÒËæ±ã¿´ÁËϹØÓÚphp°²È«µÄ×ÊÁÏ£¬²¢²»ÊǺܶ࣬ÖÁÉÙ±ÈaspÉÙ¶àÁË£¬ºÇºÇ£¬ÓÚÊǾÍÏëдµã¶«Î÷£¬À´·ÀÖ¹ÕâЩ¿ÉÄܳöÏÖµÄÇé¿ö¡£ÕâÀïûÓÐÌ«ÉîµÄ¼¼Êõº¬Á¿£¬ÎÒÖ»ÊDZȽϼòµ¥µÄ̸ÁË̸¡£(ÒÔϲÙ×÷ÈçÎÞ¾ßÌå˵Ã÷£¬¶¼ÊÇ»ùÓÚPHP+MySQL+ApacheµÄ ......

PHPʱ¼ä¼ÆËãÎÊÌâ½²½â

½üÔÚѧ[url=javascript:;]PHP[/url],һλÅóÓÑÎʵ½[url=javascript:;]ʱ¼ä[/url]µÄ¼ÆËã,´ËʱÎÒÏëµ½ÁËdelphiºÍmssqlµÄ¼ÆËã[url=javascript:;]º¯Êý[/url],ËüÃÇÓÃÆðÀ´¶¼ºÜ·½±ã,µ«²é²éphpÊֲᲢδ·¢ÏÖÀàËÆµÄʱ¼ä¼ÆË㺯Êý,ͨ¹ýÍøÎĵįô·¢ºÍ×ÔÒѵIJâÊÔ,»¹ÊÇÕÒµ½¼òµ¥µÄ[url=javascript:;]·½·¨[/url]À´ÊµÏÖ 8 =FP92X  
¾ßÌåÈ ......

PHP ¾Å¾Å³Ë·¨±í

¿ÉÒÔ¼òµ¥µÄÓÐÁ½¸ö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>";
}
?> ......

Yii PHP FrameworkʵÓÃÈëÃŽ̳Ì

˵Ã÷£ºÒòΪ×î½ü¹¤×÷¹¤×÷¹ØÏµ£¬ÐèÒª¿ª·¢Ò»¸öÔÚLinuxÏÂÔËÐеÄWeb Application£¬ÐèÒª¶ÔÏÖÔڱȽÏÁ÷ÐеÄһЩPHP¿ò¼Ü×öÒ»¸öÁ˽âºÍÆÀ¹À£¬ÏÂÃæµÄÕâÆªÎÄÕÂÊDZÊÕß×î½üѧϰһ¸ö±È½ÏеÄPHP FrameworkµÄÒ»µã¾­ÀúºÍ²Ù×÷²½Ö裬ÒòΪ¹Ù·½µÄÊÖ²áдµÃ±È½Ï»Þɬ£¨ÌرðÊÇÖÐÎĵģ©£¬Ôø¾­³¢ÊÔ±é¶ÁËüÄǸöÊÖ²áÔÙ¶¯ÊÖ£¬¶ÁÁËÒ»´ó°ë·¢ÏÖÈÔÎÞ·¨Àí½â£¬ÓÚÊÇ ......

php:global±äÁ¿µÄʹÓÃ

global¶¨ÒåÒ»¸öÈ«¾Ö±äÁ¿£¬Õâ¸öÈ«¾Ö±äÁ¿²»ÊÇÓ¦ÓÃÕû¸öÍøÕ¾£¬¶øÊÇÓ¦ÓÃÓëµ±Ç°Ò³Ãæ£¨°üÀ¨requireºÍincludeÎļþ£©Îļþ¡£
$aa="test";
function test()
{
    global $aa;
    echo $aa;
}
test(); //print test
º¯ÊýÄÚ¶¨ÒåµÄ±äÁ¿º¯ÊýÍâ¿ÉÒÔµ÷Óã¬ÔÚº¯ÊýÍⶨÒåµÄµÄ±äÁ¿º¯ÊýÄÚ²»ÄÜʹÓá£
gl ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ