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
Ïà¹ØÎĵµ£º
1.´ò¿ªÎҵĵçÄÔ£¬½øÈëDÅÌ£¬ÔÚÆäÏÂн¨Ò»¸öÎļþ¼Ð£¬ÃûΪ local ¡£
2.µ½Æä¹Ù·½Õ¾µãÏÂÔØ apache_2.2.4-win32-x86-no_ssl.msi ²¢Ö´ÐС£
3.°´3´ÎNext°´Å¥£¬°²×°³ÌÐòÒªÇóÊäÈëÄãµÄNetwork Domain£¨ÍøÂçÓòÃû£©¡¢Server Domain£¨·þÎñÆ÷ÓòÃû£©ºÍÍøÕ¾¹ÜÀíÔ±µÄE-mail£¬Óеϰ¾ÍÈçʵÌîд£¬±¾ËµÃ÷½éÉܵÄÊDZ¾µØ×Ô½¨²âÊ ......
Ò»¡¢¹æ·¶Ç°ÑÔÆª
±ê×¼»¯²»ÊÇÌØÊâµÄ¸öÈË·ç¸ñ£¬ËüÈóÌÐòÔ±¿ÉÒÔÁ˽âÈκδúÂ룬ŪÇå³ÌÐòµÄ×´¿ö£»ÐÂÈË¿É
ÒԺܿìµÄÊÊÓ¦»·¾³£»·ÀֹнӴ¥phpµÄÈËÒ»´Î´ÎµÄ·¸Í¬ÑùµÄ´íÎó£»ÔÚÒ»ÖµĿª·¢»·¾³Ï£¬
¿ÉÒÔ¼õÉÙÈËÃÇ·¸´íµÄ»ú»á¡£±¾¹æ·¶µÄ±ê×¼ÔÚ¾ø¶Ô¶àÊýÓ¦ÓÃÉÏΪ·ÂÕÕjava¼¼ÊõÌåϵ£¬ÒòΪ
java¼¼ÊõÌåϵÒÔÆäÖÚ¶à³É¹¦µÄ°¸Àý³ÉΪ´ó²¿·Ö¼ÆËã»úÓ¦Ó ......
php ʹÓÃÃüÁîÐÐ×Ô±äÁ¿
ÔÚÃüÁîÐÐÀïÊäÈë³ÌÐò²ÎÊýÀ´¸ü¸ÄÆäÔËÐз½Ê½ÊǺܳ£¼ûµÄ×ö·¨¡£ÄãÒ²¿ÉÒÔ¶ÔCLI³ÌÐòÕâÑù×ö¡£PHP
CLI´øÓÐÁ½¸öÌØÊâµÄ±äÁ¿£¬×¨ÃÅÓÃÀ´´ïµ½Õâ¸öÄ¿µÄ£ºÒ»¸öÊÇ$argv±äÁ¿£¬Ëüͨ¹ýÃüÁîÐаѴ«µÝ¸øPHP½Å±¾µÄ²ÎÊý±£´æÎªµ¥¶ÀµÄÊý×éÔªËØ£»ÁíÒ»¸ö
ÊÇ$argc±äÁ¿£¬ËüÓÃÀ´±£´æ$argvÊý×éÀïÔªËØµÄ¸öÊý¡£
ÓÃ ......
import java.io.IOException;
import java.security.SecureRandom;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class DES {
private byte ......
ÔÎÄÁ´½Ó£ºhttp://www.phpdo.net/index.php/2010/01/26/1-2/
ËùÓбà³ÌÓïÑԵĿªÊ¼:Hello,world!Ò³Ãæ¡£
Ê×ÏÈʹÓÃhtml±àдһ¸ö¼òµ¥µÄÒ³Ãæ¡£´úÂëÈçÏ£º
<html>
<head>
<title>Hello, world</title>
</head>
<body>
<H1><p align=center>Hello, world</p></H1 ......