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

PHP×Ô¶¨Òå´óСÑéÖ¤Âë

<?php
function vCode($num=4,$size=20, $width=0,$height=0){
!$width && $width = $num*$size*4/5+5;
!$height && $height = $size + 10;
// È¥µôÁË 0 1 O l µÈ
$str = "23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVW";
$code = '';
for ($i=0; $i<$num; $i++){
$code.= $str[mt_rand(0, strlen($str)-1)];
}
// »­Í¼Ïñ
$im = imagecreatetruecolor($width,$height);
// ¶¨ÒåÒªÓõ½µÄÑÕÉ«
$back_color = imagecolorallocate($im, 235, 236, 237);
$boer_color = imagecolorallocate($im, 118, 151, 199);
$text_color = imagecolorallocate($im, mt_rand(0,200), mt_rand(0,120), mt_rand(0,120));

// »­±³¾°
imagefilledrectangle($im,0,0,$width,$height,$back_color);
// »­±ß¿ò
imagerectangle($im,0,0,$width-1,$height-1,$boer_color);
// »­¸ÉÈÅÏß
for($i=0;$i<5;$i++){
$font_color = imagecolorallocate($im, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255));
imagearc($im,mt_rand(-$width,$width),mt_rand(-$height,$height),mt_rand(30,$width*2),mt_rand(20,$height*2),mt_rand(0,360),mt_rand(0,360),$font_color);
}
// »­¸ÉÈŵã
for($i=0;$i<50;$i++){
$font_color = imagecolorallocate($im, mt_rand(0,255), mt_rand(0,255), mt_rand(0,255));
imagesetpixel($im,mt_rand(0,$width),mt_rand(0,$height),$font_color);
}
// »­ÑéÖ¤Âë
@imagefttext($im, $size , 0, 5, $size+3, $text_color, 'c:\\WINDOWS\\Fonts\\simsun.ttc',$code);
header("Cache-Control: max-age=1, s-maxage=1, no-cache, must-revalidate");
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
}
?>
º¯ÊýÃèÊö¼°Àý×Ó:
<?
// 4¸ö×Ö·û,´óСΪ20
vCode(4,20);
?>


Ïà¹ØÎĵµ£º

phpʵÏÖ×¢Ê͵Äɾ³ý¡¾Ö§³Ö//£¬/*£¬/**¡¿

<?php
 $fileName="function.js";
 $file=fopen($fileName,"r");
 
 $writeStr="";
 $flag=false;//ÅжÏÊÇ·ñÓÐ/***/±ê×¼
 while($strLine=fgets($file))
 {
  if(stripos($strLine,"/*")===false || stripos($strLine,"/**")===false)
  {
 &nbs ......

Windowsϰ²×°×îеÄApache+PHP+MySQLÖ¸ÄÏ



   ´ËÎÄյݲװ·½·¨ÊÊÓÃÓÚWindows XP
쵀Apache+PHP+MySQL
°²×°£¬Í¬Ê±Ò²ÊÊÓÃÓÚWindows 2003
ϵͳϵݲװºÍÅäÖá£
1.
°²×°»·¾³
²Ù×÷ϵͳÊÇ Windows XP
ÖÐÎİæ, Apache,
PHP, MySQL
µÄ×îа汾ÊǽØÖ¹µ½ 2007.09.07
£¬·Ö±ðÔÚÆä¹ÙÍøÏÂÔØµÄ:
* Apache 2.2.6
£ºhttp://apache.mirror.phpchina.c ......

PHP±ÈASPÓÅÐãµÄÆß¸öÀíÓÉ ÄÏÈý·½

ASPÊÇ΢Èí¹«Ë¾ÊµÏÖ¶¯Ì¬ÍøÒ³µÄÒ»ÖÖ¼¼Êõ¡£
ASPÖ§³ÖһЩ½Å±¾ÓïÑÔ£¬Ö÷ÒªÒÔVBScriptΪÖ÷¡£
ÓëASPÏà±È½Ï£¬Ä㻹¿ÉÒÔÑ¡ÔñÁíÒ»Öпª·ÅÔ´´úÂë±à³ÌÓïÑÔ——PHP£¬PHP¿ÉÒÔÔËÐÐÔÚ¶àÖÖ²Ù×÷ϵͳÏ£¬ÆäÖаüÀ¨LinuxºÍwindows¡£
ËäÈ»ASPÊÇÒ»ÖÖ²»´íµÄ¼¼Êõ£¬µ«´Ó³¤Ô¶¿¼ÂÇÎÒÏàÐÅPHPÔÚ½«À´µÄ¼¼ÊõÁìÓòÀï»áÓв»·²µÄ±íÏÖ¡£
ÎÒÈÏΪÓÐÆß¸ ......

php ²»ÓÃCOM Éú³ÉexcelÎļþ

ÓÃphpÉú³ÉexcelÎļþ
<?
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test1/t";
echo "test2/t/n";
echo "test1/t";
echo "test2/t/n";
echo "test1/t";
echo "test2/t/n";
echo "test1/t";
echo "test2/t/n";
echo "test1/t";
echo "test2 ......

PHPÕýÔò±í´ïʽ

1¡¢ÈëÃżò½é
¼òµ¥µÄ˵£¬ÕýÔò±í´ïʽÊÇÒ»ÖÖ¿ÉÒÔÓÃÓÚģʽƥÅäºÍÌæ»»µÄÇ¿ÓÐÁ¦µÄ¹¤¾ß¡£ÎÒÃÇ¿ÉÒÔÔÚ¼¸ºõËùÓеĻùÓÚUNIXϵͳµÄ¹¤¾ßÖÐÕÒµ½ÕýÔò±í´ïʽµÄÉíÓ°£¬ÀýÈ磬vi±à¼­Æ÷£¬Perl»òPHP½Å±¾ÓïÑÔ£¬ÒÔ¼°awk»òsed shell³ÌÐòµÈ¡£´ËÍ⣬ÏóJavaScriptÕâÖÖ¿Í»§¶ËµÄ½Å±¾ÓïÑÔÒ²ÌṩÁ˶ÔÕýÔò±í´ïʽµÄÖ§³Ö¡£Óɴ˿ɼû£¬ÕýÔò±í´ïʽÒѾ­³¬³öÁËijÖÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ