jsonÊý¾Ý¸ñʽµÄÏ໥ת»»

µ¼Óï <?php$array_1=array(); һάÊý×é$array_2=array(); ¶þάÊý×é$array_1[& 39;username& 39;]="Aseoe";$array_1[& 39;website& 39;]="http: www aseoe com ";$array_2[& 39;member& 39;][& 39;ancto net& 39;][

<?php 
  1.  
  2.     $array_1 = array();  //һάÊý×é 
  3.     $array_2 = array();  //¶þάÊý×é 
  4.  
  5.     $array_1['username'] = "Aseoe"
  6.     $array_1['website'] = "http://www.aseoe.com/"
  7.  
  8.     $array_2['member']['ancto.net']['username'] = "ancto"
  9.     $array_2['member']['ancto.net']['website'] = "http://www.ancto.net/"
  10.  
  11.     $array_2['member']['aseoe.com']['username'] = "aseoe"
  12.     $array_2['member']['aseoe.com']['website'] = "http://www.aseoe.com/"
  13.  
  14.     //print_r($array_2); 
  15.  
  16.     $jsonObj_1 = json_encode($array_1);  //һάÊý×éת»»³ÉjsonÊý¾Ý¸ñʽ 
  17.     //echo $jsonObj_1; 
  18.  
  19.     $jsonObj_2 = json_encode($array_2);     //¶àάÊý×éת»»³ÉjsonÊý¾Ý¸ñʽ 
  20.     //echo $jsonObj_2; 
  21.  
  22.     class aseoe{ 
  23.         public $puname = "public name"
  24.         protected $poname = "protected name"
  25.         private $prname = "private name"
  26.  
  27.         public function getName(){ 
  28.             return $this->name; 
  29.         } 
  30.  
  31.     } 
  32.  
  33.     $aseoeObj = new aseoe(); 
  34.     $json_aseoe =json_encode($aseoeObj);    //¶ÔÏóת»»³ÉjsonÊý¾Ý¸ñʽ 
  35.     //echo $json_aseoe;    //¶ÔÏóת»»ÎªjsonÊý¾Ýʱ£¬Ö»×ª»»¹«ÓбäÁ¿£¬Ë½ÓбäÁ¿²»×ª»» 
  36.  
  37.     //print_r($aseoeObj); 
  38.  
  39.     $jsonStr = '{"key":"value","key1":"value2"}'
  40.     $json2Array = json_decode($jsonStr,true);  //ûÉèµÚ2¸ö²ÎÊýʱ£¬Ä¬ÈÏÊǶÔÏóÀàÐÍ 
  41.     print_r($json2Array); 

 

$jsonStr='{"key":"value","key1":"value1"}'; 
 
json_decode($jsonStr);//ת»»Ö®ºóÊǶÔÏóÀàÐÍ 
 
json_decode($jsonStr,true);//ת»»Ö®ºóÊÇÊý×é 

 


 

http://www.aseoe.com/ true jsonÊý¾Ý¸ñʽµÄÏ໥ת»» http://www.aseoe.com/show-12-467-1.html report <£¿php echo strlen($content) / 2; ?> <?php$array_1=array(); һάÊý×é$array_2=array(); ¶þάÊý×é$array_1[& 39;username& 39;]="Aseoe";$array_1[& 39;website& 39;]="http: www aseoe com ";$array_2[& 39;member& 39;][& 39;ancto net& 39;][
TAG:json ¸ñʽÊý¾Ý
±¾Õ¾»¶Ó­ÈκÎÐÎʽµÄתÔØ£¬µ«ÇëÎñ±Ø×¢Ã÷³ö´¦£¬×ðÖØËûÈËÀͶ¯³É¹û
תÔØÇë×¢Ã÷£º ÎÄÕÂתÔØ×Ô£º°®Ë¼×ÊÔ´Íø http://www.aseoe.com/show-12-467-1.html

[Ç°¶Ë²å¼þÍƼö] Plugin

1 2 3 4
  • jQueryʵÏÖÖð×ÖÖð¾äÏÔʾ²å¼þl-by-l.min.js
  • jQuery´ø·½Ïò¸ÐÖªµÄÊó±ê»¬¹ýͼƬ±ß¿òÌØЧ²å¼þ
  • jQuery HotKeys¼àÌý¼üÅÌ°´ÏÂʼþkeydown²å¼þ
  • ÏìӦʽÎÞÏÞÂÖ²¥jQueryÐýתľÂí²å¼þ
ÏìӦʽÎÞÏÞÂÖ²¥jQueryÐýתľÂí²å¼þ
webÇ°¶Ë¿ª·¢
°®Ë¼×ÊÔ´Íø Copyright 2012-2014 Www.Aseoe.Com All rights reserved.(½úICP±¸13001436ºÅ-1)