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

json + js + php ¼òµ¥½»»¥

×î½üÔÚдһ¸ö ǰ̨»ùÓÚ javascript. µÄ¿Í»§¶Ë ·þÎñÆ÷¶ËPHP µÄ·ÖÎöϵͳ¡£
Ô­Ïȼƻ®Ê¹ÓÃXMLΪÊý¾Ý½»»¥»ù´¡ µ«ÊÇ×îÖÕ»¹ÊÇÑ¡ÓýÏÇáÁ¿¼¶µÄJSON×îΪÊý¾Ý½»»¥»ù´¡¡£
Ê×ÏȽéÉÜjsonµÄ¸ñʽ
json ˵¼òµ¥ÆäʵÊÇÒ»ÖÖÊý¾Ý¸ñʽ  ¸ü¼òµ¥µÄ¿ÉÒÔ¿´×ö¼òµ¥µÄÊý×é¡£
ʵÀý £¨Ò»£©
<script>
  var jsonArray=[
                 {"house":["±ðÊû","ÉÌÆ··¿","ƽ·¿"]}
                ,{"place":["±±¾©\","¸£½¨","ºÓÄÏ"]}
       ];
  jsonArray=eval(jsonArray);
   alert(jsonArray[0].house[1]);
</script>
ʵÀý(¶þ)
PHP¶ËÉú³Éjson¸ñʽµÄÊý¾Ý
PHPÌṩÁËÁ½¸öjsonÏà¹ØµÄº¯Êý 
json_encode :²úÉújson¸ñʽÊý¾Ý
json_decode £º½âÂëjson¸ñʽÊý¾Ý ±äΪÆÕͨÊý×é
<?
$array=array(
                'house'=>array('±ðÊû','ÉÌÆ··¿','ƽ·¿'),
        "place"=>array('±±¾©','¸£½¨','ºÓÄÏ')
      );
/*
  Éú³Éjson¸ñʽ
*/
$json = json_encode($array);
echo $json;
/*
  ½âÂëjson¸ñʽ
*/
$decode_json=json_decode($json);
var_dump($decode_json);
?>
 
ת×Ô£ºhttp://163navy.blog.163.com/blog/static/105304086200982595643132/


Ïà¹ØÎĵµ£º

phpÖеÄevalºÍJavaScriptÖеÄeval

phpÖеÄevalºÍJavaScriptÖеÄevalÇø±ð£º
Definition and Usage

¶¨ÒåºÍÓ÷¨
The eval() function evaluates a
string as PHP code.
eval()º¯ÊýµÄ×÷ÓÃÊÇ£º·µ»ØÓëPHP´úÂëÏà¶ÔÓ¦µÄ×Ö·û´®¡£
The string
must be valid PHP code and must end with semicolon.
Õâ¸ö×Ö·û´®±ØÐëÊÇÓÐЧµÄPHP´úÂ룬
²¢ÇÒ±ØÐëÒԷֺŽáÊø¡ ......

¡¾±±¾©PHPÅàѵ¡¿±±¾©´óѧPHP¹¤³Ìʦ°à»ðÈÈÕÐÉú£¡


    ±±¾©´óѧPHP¹¤³Ìʦ°àÕÐÉú¼òÕÂ
   ÍøÖ·£ºwww.pku-it.com
      ½üÄêÀ´£¬PHPÓïÑÔÒÔÆä¼ò½àÁé»îµÄ±à³Ìģʽ¡¢ÈÕÇ÷ÍêÉƵļ¼ÊõÌåϵÒÔ¼°Ç¿ÓÐÁ¦µÄ¿ªÔ´Ö§³Ö£¬Ñ¸ËÙ·¢Õ¹³ÉΪȫÇò»¥ÁªÍøÓ¦ÓÃ×îΪ¹ã·ºµÄ±à³ÌÓïÑÔ¡£Ä¿Ç°ÒÑÓг¬¹ý40%µÄWEB³ÌÐòʹÓÃPHPÀ´±àд£¬°Ù¶È¡¢ÌÚÑ ......

2010Äê×îÐÂPHPÀàµÄ¾«Ëõ¹éÄÉ

Ò»£º½á¹¹ºÍµ÷ÓÃ(ʵÀý»¯)£º
class className{} £¬µ÷Óãº$obj = new className();µ±ÀàÓй¹Ô캯Êýʱ£¬»¹Ó¦´«Èë²ÎÊý¡£Èç$obj = new className($v,$v2...);
¶þ£º¹¹Ô캯ÊýºÍÎö¹¹º¯Êý£º
1¡¢¹¹Ô캯ÊýÓÃÓÚ³õʼ»¯£ºÊ¹ÓÃ__construct()£¬¿É´ø²ÎÊý¡£
2¡¢µ«Îö¹¹º¯Êý²»ÄÜ´ø²ÎÊý£¨ÓÃÓÚÔÚÏúÈ¥Ò»¸öÀà֮ǰִÐÐһЩ²Ù×÷»ò¹¦ÄÜ£©¡£Îö¹¹º¯ÊýÓà ......

nginx php mysql

°²×° Nginx
* Ò»ÌõÃüÁî¸ã¶¨£º
USE=fastcgi emerge nginx
* н¨Óû§ºÍ×飺
groupadd www
useradd www -g www
Nginx °²×°ºÃºóĬÈÏ»áÌí¼Ó nginx ×éºÍ nginx Óû§£¬²»¹ýÎÒ±¾Éí»¹ÊÇÏ°¹ßн¨¸ö www ×éºÍ www Óû§À´×ö HTTP ·þÎñÓû§¡£Èô½ñºó HTTP ·þÎñÆ÷¸ü»»Îª apache »òÊÇ lighttpd ʱ£¬Óû§ÃûºÍÓû§×é¿ÉÒÔ²»±ä¡£
°²×° M ......

YAHOO PHPÃæÊÔÌâ

ÖªµÀ²î¾àÁË£¬Å¬Á¦°É£¡
1. Which of the following will not add john to the users array?
1. $users[] = 'john';
2. array_add($users,'john');
3. array_push($users,'john');
4. $users ||= 'john';
2. What's the difference between sort(), asort() and ksort? Under what circumstances would you use each o ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ