ÓÃPHPʵÏÖÒ»¸öË«Ïò¶ÓÁÐ
<?php
class DoubleQueue
{
public $queue = array();
/**£¨Î²²¿£©Èë¶Ó **/
public function push($value)
{
return array_push($this->queue,$value);
}
/**£¨Î²²¿£©³ö¶Ó**/
public function pop()
{
return array_pop($this->queue);
}
/**£¨Í·²¿£©Èë¶Ó**/
public function enq($value)
{
return array_unshift($this->queue,$value);
}
/**£¨Í·²¿£©³ö¶Ó**/
public function deq()
{
return array_shift($this->queue);
}
/**Çå¿Õ¶ÓÁÐ**/
public function makeEmpty()
{
return unset($this->queue);
}
}
class DoubleDueue
{
public $queue = array();
public function push($value)
{
return $this->queue[] = $value;
}
public function pop()
{
$count = $this->count();
if($count >= 1)
{
$value = $this->queue[$count-1];
unset($this->queue[$count-1]);
return $value;
}
else
{
return false;
}
}
public function enq($value)
{
/*²»ºÃ×ö*/
}
public function deq()
{
/*²»ºÃ×ö*/
}
public function count()
{
return count($this->queue);
}
public function makeEmpty()
{
return unset($this->queue);
}
}
?>
Ã²ËÆÓÃÕâËĸöº¯Êý¾ÍÐÐ
array_push — ½«Ò»¸ö»ò¶à¸öµ¥ÔªÑ¹ÈëÊý×éµÄĩ⣨ÈëÕ»£©
array_unshift — ÔÚÊý×鿪ͷ²åÈëÒ»¸ö»ò¶à¸öµ¥Ôª
array_pop — ½«Êý×é×îºóÒ»¸öµ¥Ôªµ¯³ö£¨³öÕ»£©
array_shift — ½«Êý×鿪ͷµÄµ¥ÔªÒƳöÊý×é
Ïà¹ØÎĵµ£º
$thunder = ("Thunder://QUFodHRwOi8vNjAuMTkxLjYwLjEwODo4MDgwL3hweGlhemFpL0RlZXBpbl9HaG9zdF9YUF9WMTguMC5pc29aWg==");
//½âÃÜËü
$thunder = trim($thunder,'Thunder://');
$c_thunder = base64_decode($thunder);
$c_thunder = ltrim(rtrim($c_thunder,'ZZ'),'AA');
//out [url]http://60.191.60.108:8080/xpxi ......
<?php
/* Åжϳ£Á¿ÊÇ·ñ´æÔÚ*/
if (defined('MYCONSTANT')) {
echo MYCONSTANT;
}
//ÅжϱäÁ¿ÊÇ·ñ´æÔÚ
if (isset($myvar)) {
echo "´æÔÚ±äÁ¿$myvar.";
}
//ÅжϺ¯ÊýÊÇ·ñ´æÔÚ
if (function_exists('imap_open')) {
echo "´æÔÚº¯Êýimag_open\n";
} else {
echo "º¯Êýimag_open²»´æÔÚ\n";
}
//ÅжÏÀàÊÇ·ñ ......
ÎÄÕ·ÖÀà:PHP±à³Ì
PHP chmod() º¯Êý (upload image permit)
PHP Filesystem º¯Êý
¶¨ÒåºÍÓ÷¨
chmod() º¯Êý¸Ä±äÎļþģʽ¡£
Èç¹û³É¹¦Ôò·µ»Ø TRUE£¬·ñÔò·µ»Ø FALSE¡£
Óï·¨
chmod(file,mode)
²ÎÊý
ÃèÊö
file
±ØÐè¡£¹æ¶¨Òª¼ì²éµÄÎļþ¡£
mode
¿ÉÑ¡¡£¹æ¶¨ÐµÄȨÏÞ¡£
mode ²ÎÊýÓÉ 4 ¸öÊý×Ö×é³É£º
µÚÒ»¸öÊý×ÖÓ ......
1.phpÊý×é»ù´¡£º
<?php
$ary2 = "zqhung_hongzequan_zqhong";
$arr3 =explode("_",$ary2);//²ð·Ö×Ö·û´®
echo $arr3[1];//´òÓ¡³öÀ´µÄ½á¹ûÊÇhongzequan
$ary1 = array("aa","bb");
$ary1[0]="zqhung";//ÐÞ¸ÄÊý×éÖеÄÖµ
echo $ary1[0],"<br>";//´òÓ¡³öÀ´µÄ½á¹ûÊÇzqhung
$ary3 = array("id"=>55);
......