——phpͼÏñ´¦ÀíÀà
<?
* +-------------------------------------------------------------+
* | Copyright (c) 2008-2009 Diqiye.Com All rights reserved.
* +-------------------------------------------------------------+
* | Info : ͼÏñ´¦ÀíÀà
* +-------------------------------------------------------------+
*/
class image {
// µ±Ç°Í¼Æ¬
protected $img;
// ͼÏñtypes ¶ÔÓ¦±í
protected $types = array(
1 => 'gif',
2 => 'jpg',
3 => 'png',
6 => 'bmp'
);
// image
public function __construct($img=''){
!$img && $this->param($img);
}
// Info
public function param($img){
$this->img = $img;
return $this;
}
// imageInfo
public function getImageInfo($img){
$info = @getimagesize($img);
if(isset($this->types[$info[2]])){
$info['ext'] = $info['type'] = $this->types[$info[2]];
} else{
$info['ext'] = $info['type'] = 'jpg';
}
$info['type'] == 'jpg' && $info['type'] = 'jpeg';
$info['size'] = @filesize($img);
return $info;
}
// thumb(ÐÂͼµØÖ·, ¿í, ¸ß, ²Ã¼ô, ÔÊÐí·Å´ó)
public function thumb($filename,$new_w=160,$new_h=120,$cut=0,$big=0){
// »ñÈ¡ÔͼÐÅÏ¢
$info = $this->getImageInfo($this->img);
if(!empty($info[0])) {
$old_w = $info[0];
$old_h = $info[1];
$type = $info['type'];
$ext = $info['ext'];
unset($info);
// Èç¹ûÔͼ±ÈËõÂÔͼС ²¢ÇÒ²»ÔÊÐí·Å´ó
if($old_w < $new_h &a
Ïà¹ØÎĵµ£º
Óï·¨½á¹¹½Ì¿ÆÊéÉϵÄ֪ʶºÍʵ¼ÊµÄ³ÌÐòÉè¼ÆÊÇÓÐÇø±ðµÄ£¬ÕæÕýµÄ֪ʶҪÔÚʵ¼ÊµÄ¿ª·¢ÖлñµÃ¡£Ã¿¸öphpµÄ¿ª·¢ÈËÔ±ÔÚ¿ªÊ¼¿ª·¢webÓ¦ÓóÌÐò֮ǰ£¬¶¼Ó¦¸ÃÊìϤÏÂÃæµÄÎå¼þÊ£º www.phperz.com
1. ¿ò¼Ü
php³ÌÐòÔ±Ö®¼Ò
¿ò¼Ü¿ÉÒÔ˵ÊÇphp¿ª·¢ÖеÄÒ»¸ö×îÖØÒªµÄÎÊÌâ¡£ÓÃphp¿ª·¢webÓ¦ÓóÌÐòʱÓкܶ෽·¨£¬Óкܶ࿪ԴµÄ¿ò¼Ü¿ÉÒÔʹÓã¬¿É ......
$URL
=‘
http
:
//xxx.xxx.xxx.xx/xx/xxx/top.php';
$post_data
[
'
clientname
'
]
=
"
test08
"
;
$post_data
[
'
clientpasswd
'
]
=
"
test08
"
;
$post_data
[
'
submit
'
]
=
"
¥í¥°¥¤¥ó
"
;
$referrer
=
""
;
// ......
<mce:script language=javascript><!--
var a=0;
// --></mce:script>
<?php
function func1()
{
$t="a=a+1;";
return $t."alert(a)";
}
?>
<?php
echo "<input type=button value='Sure' onclick=\"".func1()."\">";
?> ......
1.PHPÊÇPHP: Hypertext PreprocessorµÄËõд,ÖÐÎÄÒëΪPHP:³¬Îı¾Ô¤´¦ÀíÆ÷.
2.PHPÊÇÒ»ÖÖ¼òµ¥µÄ,ÃæÏò¶ÔÏóµÄ,½âÊÍÐ͵Ä,½¡×³µÄ,°²È«µÄ,ÐÔÄܷdz£¸ßµÄ,¶ÀÁ¢Óڼܹ¹µÄ,¿ÉÒÆÖ²ÐÔµÄ,¶¯Ì¬µÄ·þÎñÆ÷¶Ë½Å±¾ÓïÑÔ.
3.PHP¾ßÓÐ¿çÆ½Ì¨ÐÔ,ÔÚ´ó¶àÊýUNIXƽ̨,Linuxƽ̨ºÍ΢ÈíWindowsƽ̨É϶¼¿ÉÒÔÔËÐÐ.
4.PHPÖ§³ÖJDBC,ÌṩMYSQL,Oracle,SybaseºÍM ......
PHPÊÇÈõÀàÐÍÓïÑÔ¡£
»ù±¾Êý¾ÝÀàÐÍ£ºinteger¡¢string¡¢boolean¡¢float
¸´ºÏÊý¾ÝÀàÐÍ£ºarray¡¢object
»ù±¾Êý¾ÝÀàÐ;Ͳ»ËµÁË£¬ÏÂÃæ¿´Ò»¸öÊý×éÏà¹ØµÄһЩÀý×Ó¡£
$test1=array(1,2,3,4);//¶¨ÒåÁËÒ»¸ö°üº¬4¸öÊýµÄÊý×é
$test1=array("new1"=>1,"new2"=>2);//Á½¸ö±äÁ¿µÄÊý×é,array['new1']=1,array['new2']=2
¶ ......