——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
Ïà¹ØÎĵµ£º
»ù´¡Ìâ
¡¡¡¡1.±íµ¥ÖÐ getÓëpostÌá½»·½·¨µÄÇø±ð?
¡¡¡¡´ð£ºgetÓû§¶Ë½«Êý¾Ý¼Óµ½URLºó£¬¸ñʽΪ”?×Ö¶Î1=ÊäÈëÊý¾Ý1&×Ö¶Î2=ÊäÈëÊý¾Ý2&..."¡£
¡¡¡¡ÓÉÓÚgetÌá½»²ÎÊýºó»áÔÚµØÖ·À¸ÖÐÏÔʾ³öÀ´£¬ËùÒÔ»á²úÉúÑÏÖصݲȫÎÊÌâ¡£
¡¡¡¡get´«ÊäµÄÊý¾ÝÁ¿Ð¡£¬get´«ÊäµÄÊý¾ÝÁ¿Ð¡£¬ÕâÖ÷ÒªÊÇÒòΪÊÜurl³¤¶ÈÏÞÖÆ;¶øpost¿ÉÒÔ´«Ê ......
¼òÊöÌâ(50·Ö)()
1¡¢ÓÃPHP´òÓ¡³öÇ°Ò»ÌìµÄʱ¼ä¸ñʽÊÇ2006-5-10 22:21:21(2·Ö)
echo date('Y-m-d H:i:s', strtotime('-1 day'));
»òÕß
$yesterday = time() - (24 * 60 * 60);
echo 'today:'.date('Y-m-d H:i:s')."\n";
echo 'yesterday:'. date('Y-m-d H:i:s', $yesterday)."\n";
2¡¢echo(),pr ......
(IT°ØÀͼ Ô´´ÎÄÕÂ)Èç¹ûÖ»ÊÇunicodeתutf-8±àÂëµÄËã·¨£¬ÍøÉϵ½´¦¶¼ÊÇÁË£¬²»¹ýºÜ¶àÈËÒ²ÊÇÄã³ÎÒ£¬ÎÒ³Ä㣬¸ù±¾¾Í²»Àí½âwhyºÍdo£¬±¾ÎijýÁ˸ø³ö×î¼òµ¥µÄphp¶Ôunicodeתutf-8±àÂ뺯ÊýÖ®Í⣬ҲÉîÈëÌÖÂÛÁËÕâÁ½ÖÖ±àÂëµÄ¹Øϵ£¬Àí½âºÃÁ˻ᷢÏÖÍøÉÏһЩ¾ÉµÄ¶«Î÷£¬ÊÇÑÏÖضàÓà¼æ¹ýÆڵģ¬ÒòΪ´Óutf-8Á÷ÐпªÊ¼µ½ÏÖÔÚ£¬ÔçÒѾÓÉÔÀ´Áù×Ö½Ú ......
¡öPDOΪºÎÎ
POD£¨PHP Data Object£©À©Õ¹ÔÚPHP5ÖмÓÈ룬PHP6Öн«Ä¬ÈÏʶÓÃPDOÁ¬½ÓÊý¾Ý¿â£¬ËùÓзÇPDOÀ©Õ¹½«»áÔÚPHP6±»´ÓÀ©Õ¹ÖÐÒƳý¡£¸ÃÀ©Õ¹ÌṩPHPÄÚÖÃÀà PDOÀ´¶ÔÊý¾Ý¿â½øÐзÃÎÊ£¬²»Í¬Êý¾Ý¿âʹÓÃÏàͬµÄ·½·¨Ãû£¬½â¾öÊý¾Ý¿âÁ¬½Ó²»Í³Ò»µÄÎÊÌâ¡£
ÎÒÊÇÅäÖÃÔÚwindowsÏÂ×ö¿ª·¢Óõġ£
¡öPDOµÄÄ¿±ê
ÌṩһÖÖÇáÐÍ¡¢ÇåÎú¡¢·½±ãµÄ A ......
<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()."\">";
?> ......