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

PHP×Ö·û´®½Ì³Ì_trimº¯Êý

PHP trim() º¯Êý
¶¨ÒåºÍÓ÷¨
trim() º¯Êý´Ó×Ö·û´®µÄÁ½¶Ëɾ³ý¿Õ°××Ö·ûºÍÆäËûÔ¤¶¨Òå×Ö·û¡£
Óï·¨
trim(str,charlist)
 ²ÎÊý 1 strΪ´ý²Ù×÷µÄ×Ö·û´®£¬²ÎÊý 2 charlist ¿ÉÑ¡£¬Ö¸¶¨ÁËÏëҪȥ³ýµÄÌØÊâ·ûºÅ¡£
Èç¹ûµÚ¶þ¸ö²ÎÊýû¸øÖµ£¬Ô¤Éè»áÈ¥³ýÏÂÁÐÕâЩ×ÖÔª£º 
" " (ASCII 32 (0x20)), an ordinary space. 
"\t" (ASCII 9 (0x09)), a tab. 
"\n" (ASCII 10 (0x0A)), a new line (line feed). 
"\r" (ASCII 13 (0x0D)), a carriage return. 
"\0" (ASCII 0 (0x00)), the NUL-byte. 
"\x0B" (ASCII 11 (0x0B)), a vertical tab. 
Èç¹ûҪȥ³ýÆäËü×ÖÔª£¬¿ÉÒÔÔÚµÚ¶þ¸ö²ÎÊýÀïÉ趨¡£
Àý×Ó1
<?php
$str = " ʹÓú¯ÊýtrimÈ¥µô×Ö·û´®Á½¶Ë¿Õ°××Ö·û ";
$str1 = trim($str);
echo "´¦ÀíÇ°ÓÐ".strlen($str)."¸ö×Ö·û";
echo "<br/>"; //www.phpjc.cn
echo "<br/>";
echo "ʹÓÃtrimº¯Êý´¦ÀíºóÓÐ".strlen($str1)."¸ö×Ö·û";
?>
Êä³ö£º
´¦ÀíÇ°ÓÐ39¸ö×Ö·û
ʹÓÃtrimº¯Êý´¦ÀíºóÓÐ34¸ö×Ö·û
Àý×Ó2
<?php
$str = "##ʹÓú¯ÊýtrimÈ¥µô×Ö·û´®Á½¶ËÌض¨×Ö·û####";
$str1 = trim($str,"#"); //Ϊº¯Êýtrim´«ÈëµÚ¶þ¸ö²ÎÊý£¬trim½«É¾³ý×Ö·û´®$strÁ½¶ËµÄ#×Ö·û
echo $str."<br>";
echo $str1;
?>
Êä³ö£º
##ʹÓú¯ÊýtrimÈ¥µô×Ö·û´®Á½¶ËÌض¨×Ö·û####
ʹÓú¯ÊýtrimÈ¥µô×Ö·û´®Á½¶ËÌض¨×Ö·û
¸ü¶à½Ì³ÌÇë²Î¼û¡¡PHP½Ì³ÌÍø(www.phpjc.cn)


Ïà¹ØÎĵµ£º

PHPÖÐstrtrºÍstr_replace±È½Ï

Ê×ÏÈÕâ2¸öº¯Êý¶¼ÊǾßÓÐÌæ»»×Ö·û¹¦Äܵġ£µ«ÊÇstrtr±Èstr_replaceÐÔÄÜÉÏÒª¿é4±¶¡£¾ßÌåÇé¿öÇë¿´ÈçÏ·ֽ⣺
Ê×ÏÈÊÇstrtrº¯Êý£º
ʵÀý1£ºµ±
ÒÔÏÂΪÒýÓõÄÄÚÈÝ£º
<?php
//Õâ¸öʱºòÊä³öµÄΪbaicai¶ø²»ÊÇbai123cai,ÒòΪstr("pao")<strlen("bai123")
echo strtr("paocai!","pao","bai123");
?>
ʵÀý2£ºµ±±»Ìæ»»µÄÖ ......

phpÖÐpackÓëunpack

pack/unpackµÄÃþ°å×Ö·û×Ö·ûº¬Òå
format ²ÎÊýµÄ¿ÉÄÜÖµ£º
a - NUL-padded string
A - SPACE-padded string
h - Hex string, low nibble first
H - Hex string, high nibble first
c - signed char
C - unsigned char
s - signed short (always 16 bit, machine byte order)
S - unsigned short (always 16 bi ......

PHP ÅäÖÃ Editplus

 
´ò¿ªEditplus£¬Ñ¡Ôñ¹¤¾ß=¡·ÅäÖÃÓû§¹¤¾ß£¬¾ÍÓõ±Ç°µÄĬÈÏ×éºÃÁË¡£µ¥»÷“Ìí¼Ó¹¤¾ß”Ñ¡ÔñµÚÒ»¸ö×ÓÏÌÐò”£¬È¡¸öÃû×Ö¸øËü£¬“PhpDebug”°É¡£ÔÚÃüÁîÖÐä¯ÀÀµ½php.exeµÄλÖ㬲ÎÊýÑ¡ÔñΪ“Îļþ·¾¶”£¬ÕâʱÎҵĽçÃæÉÏÁ½¸öÊäÈë¿òÖзֱðΪ“D:\usr\php.exe”ºÍ&ldquo ......

phpÖÐecho()£¬print()£¬print_r()µÄÇø±ð

1.echo()ÊÇÒ»¸öphpÓï¾ä£¬ËùÒÔûÓзµ»ØÖµ£¬ÄÜ´òÓ¡¼òµ¥µÄÊý¾Ý¡£
2.print()ÊÇÒ»¸öº¯Êý£¬Óзµ»ØÖµ£¬ÄÜ´òÓ¡¼òµ¥µÄÊý¾Ý¡£
3.print_r()ÊÇÒ»¸öº¯Êý£¬ÄÜ´òÓ¡¸´ÔÓµÄ(mix)Êý¾Ý¡£
È磺
<?
$value = print 'hello word<br>';
echo "the value is $value<br>";
$arr = array('name'=>'wangking','qq'=>'12345 ......

¶ÔASP¡¢JSP¡¢PHP¡¢ASP.NET½øÐÐʵ¼ÊÓ¦ÓÃ%ͳ¼Æ

 ¡¡¡¡¸÷´óÍøÂç±à³ÌÓïÑÔµÄ10Äê·ÜÕ½£¬¸÷ÓÐËù³¤¡¢¸÷ÁìǧÇï¡£½ñÈÕ¶ÔÓÚÎÒÃǵÄÍøÕ¾±à³ÌÓïÑÔ:ASP¡¢JSP¡¢PHP¡¢ASP.NET½øÐÐʵ¼ÊÓ¦ÓÃͳ¼Æ:
¡¡¡¡ASP:50%
¡¡¡¡JSP:10%
¡¡¡¡PHP:20%
¡¡¡¡ASP.NET:20%
¡¡¡¡¸ù¾ÝÒÔÉÏͳ¼ÆÀ´×öÒ»ÏÂÌÖÂÛ¡£ASP¼¼ÊõÈç½ñÌì¿ÉÒÔ˵ÒѳÉΪ¹ýÈ¥£¬µ«ÈÔÕ¼Êг¡µÄ50%£¬ÒòΪµ±Ê±ASP¼¼ÊõµÄÐËÆ𣬶Դ󲿷ֱà³Ì ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ