Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

PHP dataº¯ÊýµÄ³£ÓòÎÊý

a - СдµÄam»òpm
A - ´óдµÄAM»òPM
d - ÈÕ£¬Á½Î»Êý×Ö£¬²»×ãÁ½Î»Ôòǰµ¼×Ô¶¯²¹Áã
D - ±íʾÐÇÆÚµÄÓ¢ÎĵÄǰÈý¸öÓ¢ÎÄ×Öĸ
F - Ô·ݵÄÓ¢ÎÄÈ«Ãû
h - 12Ð¡Ê±ÖÆ£¬Á½Î»Êý×Ö£¬²»×ãÁ½Î»Ôòǰµ¼×Ô¶¯²¹Áã
H - 24Ð¡Ê±ÖÆ£¬Á½Î»Êý×Ö£¬²»×ãÁ½Î»Ôòǰµ¼×Ô¶¯²¹Áã
g - 12Ð¡Ê±ÖÆ£¬²»×ãÁ½Î»µÄСʱ²»²¹Áã
G - 24Ð¡Ê±ÖÆ£¬²»×ãÁ½Î»µÄСʱ²»²¹Áã
i - ·ÖÖÓ
j - ÈÕ£¬²»×ãÁ½Î»µÄÈÕ²»²¹Áã
l - ÐÇÆÚµÄÓ¢ÎÄÈ«Ãû
L - ÅжϽñÄêÊÇ·ñÈòÄ꣬·µ»Ø²¼¶ûÖµ£¬ÕæÎª1£¬·ñÔòΪ0£»
m - Ô·ݣ¬Á½Î»Êý×Ö£¬²»×ãÁ½Î»Ôòǰµ¼²¹Áã
n - Ô·ݣ¬Á½Î»Êý×Ö£¬²»×ãÁ½Î»µÄÔ·ݲ»²¹Áã
M - ±íʾÔ·ݵÄÓ¢ÎĵÄǰÈý¸öÓ¢ÎÄ×Öĸ
s - Ãë
S - Ó¢ÎÄÐòÊý
t - Ö¸¶¨Ô·ݵÄÌìÊý
T - ±íʾ·þÎñÆ÷µÄʱ¼äÇøÓòÉèÖÃ
U - ±íʾ´Ó1970Äê1ÔÂ1ÈÕµ½ÏÖÔÚµÄ×ÜÃëÊý
w - ÓÃÊý×ÖÀ´±íʾÐÇÆÚ¼¸£¬0´ú±íÐÇÆÚÈÕ£¬ÆäËüµÄÒÔ´ËÀàÍÆ
Y - ËÄλÊý×ÖÄê·Ý
y - Á½Î»Êý×ÖÄê·Ý
z - Ò»ÄêÖеĵڼ¸Ìì ......

——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($ ......

phpÖ®XMLתÊý×麯Êý

<?
/**
* xml2array() will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
* Arguments : $contents - The XML text
* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a different array structure in the return value.
* $priority - Can be 'tag' or 'attribute'. This will change the way the resulting array sturcture. For 'tag', the tags are given more importance.
* Return: The parsed XML in an array form. Use print_r() to see the resulting array structure.
* Examples: $array = xml2array(file_get_contents('feed.xml'));
* $array = xml2array(file_get_contents('feed.xml', 1, 'attribute'));
*/
function xml2array($contents, $get_attributes=1, $priority = 'tag') {
if(!$contents) return array();
if(!function_exists('xml_parser_create')) {
//print "'xml_parser_create()' ......

phpÖ®XMLתÊý×麯Êý

<?
/**
* xml2array() will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
* Arguments : $contents - The XML text
* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the tag values - this results in a different array structure in the return value.
* $priority - Can be 'tag' or 'attribute'. This will change the way the resulting array sturcture. For 'tag', the tags are given more importance.
* Return: The parsed XML in an array form. Use print_r() to see the resulting array structure.
* Examples: $array = xml2array(file_get_contents('feed.xml'));
* $array = xml2array(file_get_contents('feed.xml', 1, 'attribute'));
*/
function xml2array($contents, $get_attributes=1, $priority = 'tag') {
if(!$contents) return array();
if(!function_exists('xml_parser_create')) {
//print "'xml_parser_create()' ......

PHPµÄ±àдSQLÓï¾äʱ¶ÔÐèҪתÒå×Ö·ûµÄ´¦Àí

1. ¶ÔÓÚPHP magic_quotes_gpc=onµÄÇé¿ö£¬ ÎÒÃÇ¿ÉÒÔ²»¶ÔÊäÈëºÍÊä³öÊý¾Ý¿âµÄ×Ö·û´®Êý¾Ý×÷
addslashes()ºÍstripslashes()µÄ²Ù×÷,Êý¾ÝÒ²»áÕý³£ÏÔʾ¡£ Èç¹û´ËʱÄã¶ÔÊäÈëµÄÊý¾Ý×÷ÁËaddslashes()´¦Àí£¬
ÄÇôÔÚÊä³öµÄʱºò¾Í±ØÐëʹÓÃstripslashes()È¥µô¶àÓàµÄ·´Ð±¸Ü¡£ 2. ¶ÔÓÚPHP magic_quotes_gpc=off µÄÇé¿ö ±ØÐëʹÓÃaddslashes()¶ÔÊäÈëÊý¾Ý½øÐд¦Àí£¬µ«²¢²»ÐèҪʹÓÃstripslashes()¸ñʽ»¯Êä³ö
ÒòΪaddslashes()²¢Î´½«·´Ð±¸ÜÒ»ÆðдÈëÊý¾Ý¿â£¬Ö»ÊǰïÖúmysqlÍê³ÉÁËsqlÓï¾äµÄÖ´ÐС£ ²Î¿¼×ÊÁÏ: <PHP magic_quotes_gpcµÄÏêϸʹÓ÷½·¨> ......

PHPµÄ±àдSQLÓï¾äʱ¶ÔÐèҪתÒå×Ö·ûµÄ´¦Àí

1. ¶ÔÓÚPHP magic_quotes_gpc=onµÄÇé¿ö£¬ ÎÒÃÇ¿ÉÒÔ²»¶ÔÊäÈëºÍÊä³öÊý¾Ý¿âµÄ×Ö·û´®Êý¾Ý×÷
addslashes()ºÍstripslashes()µÄ²Ù×÷,Êý¾ÝÒ²»áÕý³£ÏÔʾ¡£ Èç¹û´ËʱÄã¶ÔÊäÈëµÄÊý¾Ý×÷ÁËaddslashes()´¦Àí£¬
ÄÇôÔÚÊä³öµÄʱºò¾Í±ØÐëʹÓÃstripslashes()È¥µô¶àÓàµÄ·´Ð±¸Ü¡£ 2. ¶ÔÓÚPHP magic_quotes_gpc=off µÄÇé¿ö ±ØÐëʹÓÃaddslashes()¶ÔÊäÈëÊý¾Ý½øÐд¦Àí£¬µ«²¢²»ÐèҪʹÓÃstripslashes()¸ñʽ»¯Êä³ö
ÒòΪaddslashes()²¢Î´½«·´Ð±¸ÜÒ»ÆðдÈëÊý¾Ý¿â£¬Ö»ÊǰïÖúmysqlÍê³ÉÁËsqlÓï¾äµÄÖ´ÐС£ ²Î¿¼×ÊÁÏ: <PHP magic_quotes_gpcµÄÏêϸʹÓ÷½·¨> ......

PHPËæ»úÊýÉú³ÉÓëʹÓýâÎö

ÔÚPHP³ÌÐòÉè¼ÆÖУ¬Ëæ»úÊýµÄÉú³ÉÓÈÎªÖØÒª¡£ÎÒÃÇÐèÒªÓÃËæ»úÊýÔÚÎÒÃǵÄÒ³ÃæÖÐÕ¹Ê¾Ëæ»ú¼Ç¼£¨±ÈÈçͼƬ¡¢Óû§¼Ç¼¡¢ÎÄÕÂIDµÈ£©¡£ÎÒÃÇ»¹¿ÉÒÔʹÓÃËæ»úÊýÉè¼ÆÈκÎÎÒÃÇÏëÏóµÄ³ÌÐò½á¹¹¡£
Ê×ÏÈÀ´ÈÏʶһÏÂPHPÌṩµÄËæ»úÊýº¯Êýrand()¡£PHPµÄrand()º¯Êý½«·µ»ØËæ»úÕûÊý£¬¾ßÌåʹÓ÷½·¨ÈçÏÂ
rand(min,max)
¿ÉÑ¡²ÎÊýminºÍmax¿ÉÒÔʹrand() ·µ»Ø0µ½RAND_MAXÖ®¼äµÄÎ±Ëæ»úÕûÊý¡£ÀýÈ磬ÏëÒª5µ½15£¨°üÀ¨ 5 ºÍ 15£©Ö®¼äµÄËæ»úÊý£¬Óà rand(5, 15)¡£
ÏÂÃæÎÒÀ´¿´Ò»¸ö¾ßÌåµÄʾÀý£¬ÎÒÃÇ×öÒ»¸ö»ù±¾µÄº¯Êýµ÷Ó㬲»ÉèÖþßÌåµÄ²ÎÊý£¬ÎÒÃǵõ½µÄËæ»úÊý½«²»ÊÜminºÍmaxÁ½¸ö²ÎÊýµÄÏÞÖÆ¡£
echo
(rand());?> 
µÃµ½µÄ½á¹û£º652696728 (Ëæ»ú½á¹û)
1¡¢Ê¹ÓÃPHPÉú³ÉÖ¸¶¨Çø¼äÄÚµÄËæ»úÊý
Èç¹ûÎÒÃÇÒªÉú³ÉÁ½¸öÊý×ÖÖ®¼äµÄËæ»úÊý£¬ÎÒÃÇÐèҪΪrandÉ趨Á½¸ö²ÎÊý£º
ÕâÑù£¬ÎÒÃǵõ½µÄ½á¹û¾ÍÔÚÎÒÃǵĿØÖÆÖ®ÖУ¬ËûÓ¦¸ÃÊÇMinNum <= result <= MaxNum£»¼ÙÉèÎÒÃÇҪʹÓÃPHPÉú³É10000µ½2000Ö®¼äµÄËæ»úÊý£¬ÎÒÃǵĴúÂëÓ¦¸ÃÕâÑùд£º
echo
(rand(1000,2000));?> 
¹»¼òµ¥°É£¬ÏÂÃæÀ´µãÉÔ΢ÓÐЩÄѶȵġ£ÔÚ±¾ÎĵĿªÊ¼ÎÒÃÇ˵¹ý£¬Ëæ»úÊýµÄ×÷Óúܴó£¬ÎÒÃÇ¿ÉÒÔÓÃPHPËæ»úÊý½â¾öһЩ¸´ÔÓµÄÎÊÌâ¡£
2¡¢Ê¹ÓÃPHP»ñµÃÒ»¸ö¼¯º ......

25¸öPHPÓÎÏ·±à³Ì½Å±¾´úÂë


±¾ÎĽéÉܵĽű¾Ò×ÓÚÀí½â¡¢Ê¹Óüòµ¥²¢¿ÉÒÔ¿ìËÙÕÆÎÕ¡£
¼òµ¥µÄÖÀ÷»Æ÷
Ðí¶àÓÎÏ·ºÍÓÎϷϵͳ¶¼ÐèÒª÷»×Ó¡£ÈÃÎÒÃÇÏÈ´Ó¼òµ¥µÄ²¿·ÖÈëÊÖ£ºÖÀÒ»¸öÁùÃæ÷»×Ó¡£Êµ¼ÊÉÏ£¬¹ö¶¯Ò»¸öÁùÃæ÷»×Ó¾ÍÊÇ´Ó 1 µ½ 6 Ö®¼äÑ¡ÔñÒ»¸öËæ»úÊý×Ö¡£ÔÚ PHP ÖУ¬ÕâÊ®·Ö¼òµ¥£ºecho rand(1,6);¡£
ÔÚÐí¶àÇé¿öÏ£¬Õâ»ù±¾ÉϺܼòµ¥¡£µ«ÊÇÔÚ´¦Àí»úÂÊÓÎϷʱ£¬ÎÒÃÇÐèҪһЩ¸üºÃµÄʵÏÖ¡£PHP ÌṩÁ˸üºÃµÄËæ»úÊý×ÖÉú³ÉÆ÷£ºmt_rand()¡£ÔÚ²»ÉîÈëÑо¿Á½Õß²î±ðµÄÇé¿öÏ£¬¿ÉÒÔÈÏΪ mt_rand ÊÇÒ»¸ö¸ü¿ì¡¢¸üºÃµÄËæ»úÊý×ÖÉú³ÉÆ÷£ºecho mt_rand(1,6);¡£Èç¹û°Ñ¸ÃËæ»úÊý×ÖÉú³ÉÆ÷·ÅÈ뺯ÊýÖУ¬ÔòЧ¹û»á¸üºÃ¡£
Çåµ¥ 1. ʹÓà mt_rand() Ëæ»úÊý×ÖÉú³ÉÆ÷º¯Êý
¡¡¡¡function roll () {
¡¡¡¡return mt_rand(1,6);
¡¡¡¡}
¡¡¡¡echo roll();
È»ºó¿ÉÒÔ°ÑÐèÒª¹ö¶¯µÄ÷»×ÓÀàÐÍ×÷Ϊ²ÎÊý´«µÝ¸øº¯Êý¡£
Çåµ¥ 2. ½«÷»×ÓÀàÐÍ×÷Ϊ²ÎÊý´«µÝ
¡¡¡¡function roll ($sides) {
¡¡¡¡return mt_rand(1,$sides);
¡¡¡¡}
¡¡¡¡echo roll(6);  // roll a six-sided die
¡¡¡¡echo roll(10);  // roll a ten-sided die
¡¡¡¡echo roll(20);  // roll a twenty-sided die
´ÓÕâÀ↑ʼ£¬ÎÒÃÇ¿ÉÒÔ¼ÌÐø¸ù¾ÝÐèÒªÒ»´Î¹ö¶¯¶à¸ö÷»×Ó£¬·µ»Ø½á¹ûÊý×飻Ҳ¿ÉÒÔ ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [4726] [4727] [4728] [4729] 4730 [4731] [4732] [4733] [4734] [4735]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ