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

phpÖÐutf 8±àÂëÏÂÓÃÕýÔò±í´ïʽÈçºÎÆ¥Å人×Ö

ÐèÒªÓõÄphpµÄÕý¹æÆ¥Å人×Ö£¬ÔÚÍøÉÏÕÒÁËЩÎÄÕ¿´ÁËÒÔÏ£¬¿´µ½Õâ¸öµÄʱºò¸Ð¾õÕâƪÎÄÕÂдµÄºÜÕæʵ£¬È̲»×¡×ª¹ýÀ´ÁË¡£
Ô­ÎĵØÖ·£ºhttp://hi.baidu.com/comdeng/blog/item/f272362e47ce29564ec226c5.html
ÔÚjavascriptÖУ¬ÒªÅжÏ×Ö·û´®ÊÇÖÐÎÄÊǺܼòµ¥µÄ¡£±ÈÈ磺
var str = "php±à³Ì";
if (/^[\u4e00-\u9fa5]+$/.test(str)) {
alert("¸Ã×Ö·û´®È«²¿ÊÇÖÐÎÄ");
} else {
alert("¸Ã×Ö·û´®²»È«²¿ÊÇÖÐÎÄ");
}
Ï뵱ȻµÄ£¬ÔÚphpÖÐÀ´ÅжÏ×Ö·û´®ÊÇ·ñΪÖÐÎÄ£¬¾Í»áÑØÏ®Õâ¸ö˼·£º
<?php
$str = "php±à³Ì";
if (preg_match("/^[\u4e00-\u9fa5]+$/",$str)) {
print("¸Ã×Ö·û´®È«²¿ÊÇÖÐÎÄ");
} else {
print("¸Ã×Ö·û´®²»È«²¿ÊÇÖÐÎÄ");
}
?>
²»¹ý£¬ºÜ¿ì¾Í»á·¢ÏÖ£¬php²¢²»Ö§³ÖÕâÑùµÄ±í´ï£¬±¨´í£º
Warning
: preg_match() [function.preg-match
]: Compilation failed: PCRE does not support \L, \l, \N, \U, or \u at offset 3 in test.php
on line 3
¸Õ¿ªÊ¼´ÓgoogleÉϲéÁ˺ܶà´Î£¬Ïë´ÓphpÕýÔò±í´ïʽ¶ÔÓÚÊ®Áù½øÖÆÊý¾ÝµÄ±í´ï·½Ê½ÉϽøÐÐÍ»ÆÆ£¬·¢ÏÖÔÚphpÖУ¬ÊÇÓÃ\x±íʾʮÁù½øÖÆÊý¾ÝµÄ¡£ÓÚÊÇ£¬±ä»»³ÉÈçϵĴúÂ룺
$str = "php±à³Ì";
if (preg_match("/^[\x4e00-\x9fa5]+$/",$str)) {
print("¸Ã×Ö·û´®È«²¿ÊÇÖÐÎÄ");
} else {
print("¸Ã×Ö·û´®²»È«²¿ÊÇÖÐÎÄ");
}
òËƲ»±¨´íÁË£¬ÅжϵĽá¹ûÒ²ÕýÈ·£¬²»¹ý°Ñ$str»»³É“±à³Ì”Á½×Ö£¬½á¹ûÈ´»¹ÊÇÏÔʾ“¸Ã×Ö·û´®²»È«²¿ÊÇÖÐÎÄ”£¬¿´À´ÕâÑùµÄÅжϻ¹ÊDz»¹»×¼È·¡£
ºóÀ´ÅܻذٶÈËÑ“php Æ¥Å人×Ö utf 8
”£¬·¢ÏÖÎÄÕµÄÆ¥Åä³Ì¶È¾¹È»Òª±ÈgoogleµÄ¸ß¶àÁË£¬¿´À´°Ù¶ÈµÄ“°Ù¶È¸ü¶®ÖÐÎÄ”»¹ÔÚÒ»¶¨³Ì¶ÈÉÏÊÇÕýÈ·µÄ¡£ÔÚµÚ¶þƪÎÄÕ¡¶¡ï¡ï¡ï ÇóUTF8ÏÂÆ¥Å人×ÖµÄÕýÔò, ÔÚÏßµÈ.........
¡·Öп´µ½ÁËÈçϵÄһЩÄÚÈÝ£º
Â¥Ö÷zhiin£¨©¬ Jcan ©¬£©2006-11-15 15:59:30 ÔÚ Web ¿ª·¢ / PHP ÌáÎÊ
ÇóUTF8ÏÂÆ¥Å人×ÖµÄÕýÔò,   ²»°üÀ¨È«½Ç×Ö·û¼°ÌØÊâ·ûºÅ!
  
ÍøÉÏÖ»ÄÜÕÒµ½Æ¥ÅäÈ«½Ç×Ö·ûµÄÕýÔò:   ^[\x80-\xff]*^/   
[\u4e00-\u9fa5]¿ÉÒÔÆ¥ÅäÖÐÎÄ,µ«ÊÇPHPÓÖ²»Ö§³Ö   
  
ÓôÃÆÖÐ.......
1 Â¥PleaseDoTellMeWhy£¨Allah bless you!£©»Ø¸´ÓÚ 2006-11-15 16:04:55


Ïà¹ØÎĵµ£º

PHP $_GET


$_GET ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="get" µÄ±íµ¥ÖеÄÖµ¡£
$_GET ±äÁ¿
$_GET ±äÁ¿ÊÇÒ»¸öÊý×飬ÄÚÈÝÊÇÓÉ HTTP GET ·½·¨·¢Ë͵ıäÁ¿Ãû³ÆºÍÖµ¡£
$_GET ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="get" µÄ±íµ¥ÖеÄÖµ¡£´Ó´øÓÐ GET ·½·¨µÄ±íµ¥·¢Ë͵ÄÐÅÏ¢£¬¶ÔÈκÎÈ˶¼ÊǿɼûµÄ£¨»áÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸£©£¬²¢ÇÒ¶Ô·¢Ë͵ÄÐÅÏ¢Á¿Ò²ÓÐÏÞÖÆ£¨×î¶à 100 ¸ö ......

PHP Cookies


cookie ³£ÓÃÓÚʶ±ðÓû§¡£
ʲôÊÇ Cookie£¿
cookie ³£ÓÃÓÚʶ±ðÓû§¡£cookie ÊÇ·þÎñÆ÷ÁôÔÚÓû§¼ÆËã»úÖеÄСÎļþ¡£Ã¿µ±ÏàͬµÄ¼ÆËã»úͨ¹ýä¯ÀÀÆ÷ÇëÇóÒ³Ãæʱ£¬Ëüͬʱ»á·¢ËÍ cookie¡£Í¨¹ý PHP£¬ÄúÄܹ»´´½¨²¢È¡»Ø cookie µÄÖµ¡£
ÈçºÎ´´½¨ cookie£¿
setcookie() º¯ÊýÓÃÓÚÉèÖà cookie¡£
×¢ÊÍ£ºsetcookie() º¯Êý±ØÐëλÓÚ <ht ......

PHP¿ª·¢¹æ·¶£¡

Ò»¡¢¹æ·¶Ç°ÑÔƪ
±ê×¼»¯²»ÊÇÌØÊâµÄ¸öÈË·ç¸ñ£¬ËüÈóÌÐòÔ±¿ÉÒÔÁ˽âÈκδúÂ룬ŪÇå³ÌÐòµÄ×´¿ö£»ÐÂÈË¿É
ÒԺܿìµÄÊÊÓ¦»·¾³£»·ÀֹнӴ¥phpµÄÈËÒ»´Î´ÎµÄ·¸Í¬ÑùµÄ´íÎó£»ÔÚÒ»ÖµĿª·¢»·¾³Ï£¬
¿ÉÒÔ¼õÉÙÈËÃÇ·¸´íµÄ»ú»á¡£±¾¹æ·¶µÄ±ê×¼ÔÚ¾ø¶Ô¶àÊýÓ¦ÓÃÉÏΪ·ÂÕÕjava¼¼ÊõÌåϵ£¬ÒòΪ
java¼¼ÊõÌåϵÒÔÆäÖÚ¶à³É¹¦µÄ°¸Àý³ÉΪ´ó²¿·Ö¼ÆËã»úÓ¦Ó ......

php smarty»ù±¾Ê¹ÓÃ

1.»ù±¾Àà
//smarty_config.php
<?php
define('TEMPLATE_DIR','templates/');
define('COMPILE_DIR','templates_c/');
define('CONFIG_DIR','configs/');
define('CACHE_DIR','cache/');
?>
//View.class.php
<?php
//ÅäÖÃÎļþ
require_once 'configs/smart_config.php';
//SmartyÀà
require('smarty/ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ