PHPÊý¾Ý½á¹¹——ÏßÐÔ±íµÄɾ³ý
function delete_array_element($arr,$i) {
$len = count($arr);
for($j=$i; $j<$len; $j++) {
$arr[$j] = $arr[$j+1];
}
array_pop($arr);//½«Êý×éµÄ×îºóÒ»¸öµ¥Ôªµ¯³ö
return $arr;
}
for($i=0; $i<10; $i++) {
$arr1[$i] = $i+1;
}
print_r($arr1);
echo "<br>";
print_r(delete_array_element($arr1,5));
Êä³ö½á¹¹£º
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 10 )
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 7 [6] => 8 [7] => 9 [8] => 10 )
Ïà¹ØÎĵµ£º
0¡¢Óõ¥ÒýºÅ´úÌæË«ÒýºÅÀ´°üº¬×Ö·û´®
£¬ÕâÑù×ö»á¸ü¿ìһЩ¡£ÒòΪPHP»áÔÚË«ÒýºÅ°üΧµÄ×Ö·û´®ÖÐËÑѰ±äÁ¿£¬µ¥ÒýºÅÔò²»»á£¬×¢Ò⣺ֻÓÐechoÄÜÕâô×ö£¬ËüÊÇÒ»ÖÖ¿ÉÒ԰Ѷà¸ö×Ö·û´®µ±×÷²ÎÊýµÄ“º¯Êý”£¨Òë×¢£ºPHPÊÖ²áÖÐ˵echoÊÇÓïÑԽṹ£¬²»ÊÇÕæÕýµÄº¯Êý£¬¹Ê°Ñº¯Êý¼ÓÉÏÁËË«ÒýºÅ£©¡£
1¡¢Èç¹ûÄܽ«ÀàµÄ·½·¨¶¨Òå³Éstatic£¬¾Í¾ ......
<?php
/*
Version: v1.0
CopyRight Davis.z 2010
Creation Date 2010-02-25
----------------------- Table Script ------------------------
CREATE TABLE [dbo].[T_Employee](
[Name] [nvarchar](50) COLLATE Korean_90_CS_AS NOT NULL,
[Age] [nvarchar](5) COLLATE Korean_90_CI_AS NULL,
[ ......
PHPÖÐÉè¼ÆÄ£Ê½µÄѧϰ±Ê¼Ç
Éè¼ÆÄ£Ê½(Design Pattern)ÊÇÃæÏò¶ÔÏóÉè¼ÆÖз´¸´³öÏÖµÄÎÊÌâµÄ½â¾ö·½°¸£¬Éè¼ÆÄ£Ê½ÊÇÒ»ÖÖ±ÈÒ»°ãÀàµÄÉè¼Æ¸ü¼Ó³éÏóµÄÒ»ÖÖ˼Ï룬
ËüÍùÍùÉæ¼°µ½¶à¸öÀàµÄ¶¨ÒåºÍʹÓá£
ÔÚPHPµÄ¿ª·¢¹ý³ÌÖУ¬¾³£Ê¹Óõ½µÃÉè¼ÆÄ£Ê½°üÀ¨£º¼òµ¥¹¤³§Ä£Ê½¡¢µ¥ÔªËØÄ£Ê½¡¢¹Û²ìÕßģʽ¡¢ÃüÁîģʽ¡¢²ßÂÔģʽÒÔ¼°MVCģʽµÈ¡£
/ ......
<?php
//GB2312µÄEncode
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
/*ÖØµãÁ˽âstrtotime()º¯Êý
1¡¢strftime±Ètime()ºÃÓ㬿ÉÒÔÖ±½Ó°Ñ³£ÓõĒ2010-02-03‘ת³Éʱ¼ä´Á¡£
2¡¢date( ......