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

PHPÓëJS È¡ÕûÊý·½·¨int,celi,floor,round

PHPÓëJS---È¡ÕûÊý·½·¨int,celi,floor,round
1.¶ªÆúСÊý²¿·Ö,±£ÁôÕûÊý²¿·Ö
php: intval(7/2)
js:parseInt(7/2)
2.ÏòÉÏÈ¡Õû,ÓÐСÊý¾ÍÕûÊý²¿·Ö¼Ó1
php: ceil(7/2)
js: Math.ceil(7/2)
3,ËÄÉáÎåÈë.
php: round(7/2)
js: Math.round(7/2)
4,ÏòÏÂÈ¡Õû
php: floor(7/2)
js: Math.floor(7/2)
ÒÔÉÏת×Ô:http://hi.baidu.com/realsoso/blog/item/41bae603d515d0dc267fb536.html
 
<input onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo')">
<input name=txt1 onchange="if(/\D/.test(this.value)){alert('Ö»ÄÜÊäÈëÊý×Ö');this.value='';}">
¸öÈ˸оõphpµÄfloorº¯ÊýÓëintvalº¯Êý¹¦ÄÜÏàͬ£¬Ëù²»Í¬Ö®´¦ÊÇÒ»¸ö·µ»ØµÄÕûÊý£¬¶øÁíÒ»¸öÊǸ¡µãÊý£¬²»¹ý¾ÍÊýÖµ±¾ÉíÀ´ËµÁ½ÕßÊÇÏàµÈµÄ£¬ÒòΪfloorÊǸ¡µãÊýÔÚ¾«¶ÈÉÏÒª±ÈintvalÒª¸ßµã¡£
intval
int intval ( mixed $var [, int $base ] )
ͨ¹ýʹÓÃÌØ¶¨µÄ½øÖÆ×ª»»£¨Ä¬ÈÏÊÇÊ®½øÖÆ£©£¬·µ»Ø±äÁ¿ var µÄ integer ÊýÖµ¡£
var ¿ÉÒÔÊÇÈκαêÁ¿ÀàÐÍ¡£intval() ²»ÄÜÓÃÓÚ array »ò object¡£
 
 
(PHP 4, PHP 5)
floor — ÉáÈ¥·¨È¡Õû
·µ»Ø²»´óÓÚ value µÄÏÂÒ»¸öÕûÊý£¬½« value µÄСÊý²¿·ÖÉáȥȡÕû¡£floor() ·µ»ØµÄÀàÐÍÈÔÈ»ÊÇ float£¬ÒòΪ float ÖµµÄ·¶Î§Í¨³£±È integer Òª´ó¡£
 


Ïà¹ØÎĵµ£º

ÓÃPHPµÄob_start();¿ØÖÆÄúµÄä¯ÀÀÆ÷cache!


Output Control º¯Êý¿ÉÒÔÈÃÄã×ÔÓÉ¿ØÖƽű¾ÖÐÊý¾ÝµÄÊä³ö¡£Ëü·Ç³£µØÓÐÓã¬ÌرðÊǶÔÓÚ£ºµ±ÄãÏëÔÚÊý¾ÝÒѾ­Êä³öºó£¬ÔÙÊä³öÎļþÍ·µÄÇé¿ö¡£Êä³ö¿ØÖƺ¯Êý²»¶ÔʹÓà header() »ò setcookie(), ·¢Ë͵ÄÎļþÍ·ÐÅÏ¢²úÉúÓ°Ïì,Ö»¶ÔÄÇЩÀàËÆÓÚ echo() ºÍ PHP ´úÂëµÄÊý¾Ý¿éÓÐ×÷Óá£
ÎÒÃÇÏȾÙÒ»¸ö¼òµ¥µÄÀý×Ó£¬Èôó¼Ò¶ÔOutput ControlÓÐÒ»¸ö´ ......

php printfº¯Êý¼ò½é¼°¸ñʽ»¯¹æ¶¨·û½éÉÜ

printf()º¯ÊýÊǸñʽ»¯Êä³öº¯Êý, Ò»°ãÓÃÓÚÏò±ê×¼Êä³öÉ豸°´¹æ¶¨¸ñʽÊä³öÐÅÏ¢¡£ÔÚ±àд³ÌÐòʱ¾­³£»áÓõ½´Ëº¯Êý¡£º¯ÊýµÄÔ­ÐÍΪ£º
int printf(string $fromat [,mixed $args [,mixed ...]])
º¯Êý·µ»ØÖµÎªÕûÐÍ¡£Èô³É¹¦Ôò·µ»ØÊä³öµÄ×Ö·ûÊý£¬Êä³ö³ö´íÔò·µ»Ø¸ºÖµ¡£
printf()º¯ÊýµÄµ÷ÓøñʽΪ:
printf("<¸ñʽ»¯×Ö·û´®>", & ......

¡¾PHPϵÁн̡̳¿(3)——PHPµÄÀàÐÍ

PHPÖ§³Ö8ÖÖԭʼÀàÐÍ£¬ÆäÖаüÀ¨£º
4ÖÖ±êÁ¿ÀàÐÍ£ºboolean(²¼¶ûÐÍ)¡¢integer(ÕûÐÍ)¡¢float(¸¡µãÐÍ)¡¢string(×Ö·ûÐÍ)£»
2ÖÖ¸´ºÏÀàÐÍ£ºarray(Êý×é)¡¢object(¶ÔÏó)£»
2ÖÖÌØÊâÀàÐÍ£ºresource(×ÊÔ´)¡¢NULL
Äú¿ÉÄÜ»¹»á¶Áµ½Ò»Ð©¹ØÓÚ“Ë«¾«¶È£¨double£©”ÀàÐ͵IJο¼¡£Êµ¼ÊÉÏ double ºÍ float ÊÇÏàͬµÄ£¬ÓÉÓÚһЩÀúÊ·µÄÔ­ ......

½â¶ÁPHP DOMDocumentÔÚ½âÎöXMLÎļþÖеÄ×÷ÓÃ

½â¶ÁPHP DOMDocumentÔÚ½âÎöXMLÎļþÖеÄ×÷ÓÃ
http://developer.51cto.com  2009-12-02 10:39  ØýÃû  Áø³Ç²©¿Í  ÎÒÒªÆÀÂÛ(0)
PHP DOMDocumentµÄ¹¦Äܷdz£Ç¿´ó£¬ÎÒÃÇÔÚÕâÆªÎÄÕÂÖн«½éÉÜÈçºÎÕýÈ·µÄÔËÓÃPHP DOMDocumentÀ´½øÐÐXMLÎļþµÄ½âÎö¡£Ï£Íû¶ÔÓÖÐèÒªµÄÅóÓÑÓÐËù°ïÖú¡£
ÔÚʹÓÃPHP¶ÔXMLÎļþ½øÐнâÎöµÄʱ ......

php½âÎöxmlʾÀý

<!-- xml ¸ñʽ
<books>
<book id='1001'>
<author>andylin</author>
<title>c language</title>
<publisher id="aaa">O'Reilly</publisher>
</book>

<book id='1002'>
<author>congfeng</author>
<t ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ