php³£Óú¯Êý2
Îļþ¶ÁÈ¡º¯Ê½
//Îļþ¶ÁÈ¡º¯Ê½
function PHP_Read($file_name) {
$fd=fopen($file_name,r);
while($bufline=fgets($fd, 4096)){
$buf.=$bufline;
}
fclose($fd);
return $buf;
}
?>
ÎļþдÈ뺯ʽ
//ÎļþдÈ뺯ʽ
function PHP_Write($file_name,$data,$method="w") {
$filenum=@fopen($file_name,$method);
flock($filenum,LOCK_EX);
$file_data=fwrite($filenum,$data);
fclose($filenum);
return $file_data;
}
?>
¾²Ì¬Ò³ÃæÉú³Éº¯Ê½
//¾²Ì¬Ò³ÃæÉú³Éº¯Ê½
function phptohtm($filefrom,$fileto,$u2u=1){
if($u2u==1){
$data=PHP_Read($filefrom);
}else{
$data=$filefrom;
}
PHP_Write($fileto,$data);
return true;
}
?>
Ö¸¶¨Ìõ¼þÐÅÏ¢ÊýÁ¿¼ìË÷º¯Ê½
//Ö¸¶¨Ìõ¼þÐÅÏ¢ÊýÁ¿¼ìË÷º¯Ê½
function rec_exist($table,$where){
$query="select count(*) as num from $table ".$where;
$result=mysql_query($query) or die(nerror(1));
$rowcount=mysql_fetch_array($result);
$num=$rowcount["num"];
if ($num==0){
return false;
}
return $num;
}
?>
Ŀ¼ɾ³ýº¯Ê½
//Ŀ¼ɾ³ýº¯Ê½
function del_DIR($directory){
$mydir=dir($directory);
while($file=$mydir->read()){
if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){
del_DIR("$directory/$file");
}else{
if(($file!=".") AND ($file!="..")){
unlink("$directory/$file");
//echo "unlink $directory/$file ok ";
}
Ïà¹ØÎĵµ£º
Ò»¡¢PHPº¯ÊýDate()»ñÈ¡µ±Ç°Ê±¼ä
´úÂ룺
<?php echo $showtime=date("Y-m-d H:i:s");?>
ÏÔʾµÄ¸ñʽ: Äê-ÔÂ-ÈÕ Ð¡Ê±:·ÖÖÓ:Ãë
Ïà¹Ø²ÎÊý£º
a£º"am"»òÕß"pm"
A£º"AM"»òÕß"PM"
d£º¼¸ÈÕ£¬¶þλÊý×Ö£¬Èô²»×ã¶þλÔòÇ°Ãæ²¹Á㣬Èç: "01"ÖÁ"31"
D£ºÐÇÆÚ¼¸£¬Èý¸öÓ¢ÎÄ×Öĸ£¬Èç: "Fri"
F£ºÔ·ݣ¬Ó¢ÎÄÈ«Ãû£¬Èç: "Jan ......
phpÖÐsubstrµÄÓ÷¨Ïê½â
php.netÖйØÓÚsubstrµÄ˵Ã÷ºÜ¼òµ¥:
start
If start is non-negative, the returned string will start at the start 'th position in string , counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so for ......
ÔÚÍøÕ¾Éè¼ÆÖÐÎÒÃǾ³£»áÓöµ½ÐèÒª¶àÓïÑÔÖ§³ÖµÄÇé¿ö¡£¶àÓïÑÔϵͳ°´ÕÕÖ§³ÖµÄ·½Ê½Ò»°ã¿É·ÖΪÁ½ÖÖ£º
1.Ö§³Ö¶àÓïÑÔ£¬µ«²»Ö§³Ö¶àÖÖÓïÑÔµÄͬʱ´æÔÚ£¬Ò²¾ÍÊÇ˵ҪôÊÇÖÐÎÄҪôÊÇÓ¢ÎÄ»òÕ߯äËû£¬ÕâÔÚһЩÐèÒª¹ú¼Ê»¯Ö§³ÖµÄÍøÒ³ÏµÍ³Öо³£ÓÃÀ´£¬ÒԱ㷽±ãÓû§±¾µØ»¯¡£ 2.Ö§³Ö¶àÓïÑÔ²¢¿Éͬʱä¯ÀÀ²»Í¬ÓïÑÔ°æ±¾µÄÍøÒ³¡£½ñÌìÎÒÏëÌÖ ......
<?php
/*
* Created on 2009-10-28
* ·Ö×ÓÈçÃÎo(╯¡õ╰)o
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
interface pusb{
function verson();
  ......
±¾ÎÄת×Ô:http://www.msphome.cn/post/119/
×î½üÒòΪҪ¶ÔÒ»¸öÏîÄ¿½øÐÐÖØ¹¹£¬ËùÒÔÒ»Ö±ÔÚÑо¿PHP¿ò¼Ü¡£´óÌå¿´ÁË¿´Zend Frameworks£¬×ÐϸѧϰÁËÏÂsymfony£¬·¢ÏÖÒ»¸öÁ¼ºÃµÄMVC Web¿ò¼Ü£¬×ãÒԸı俪·¢Ï°¹ß¡£µ«ÊÇÎÞÂÛÊÇZend Frameworks»¹ÊÇsymfony£¬¶ÔÓÚÖÐСÐÍÏîÄ¿µÄ¿ª·¢À´Ëµ¶¼¹ýÓÚÓ·Ö×£¬²¢²»ÄܺܺõÄÌáÉý¿ª· ......