2011-04-12 2 views
0
"NewsML": [ 
     { 
"Identification": {"NewsIdentifier":  { 
     "ProviderId": "timesofindia.com", 
     "NewsItemId": "7954765" 
     }}, 
     "NewsLines":  { 
     "HeadLine": "I want KKR to win for Ganguly: Shah Rukh", 
     "DateLine": "IANS, Apr 12, 2011, 04.41am IST" 
     }, 
     "NewsComponent":  [ 
       { 
      "Role": {"@FormalName": "WebURL"}, 
      "ContentItem":   { 
      "MediaType": {"@FormalName": "Link"}, 
      "DataContent": {"media-caption": "http://timesofindia.indiatimes.com/sports/cricket/ipl-2011/news/I-want-KKR-to-win-for-Ganguly-Shah-Rukh/articleshow/7954765.cms"} 
      } 
     }, 
       { 
      "Role": {"@FormalName": "Caption"}, 
      "ContentItem":   { 
      "MediaType": {"@FormalName": "Text"}, 
      "DataContent": {"media-caption": "Aware of the negative vibes in Kolkata after the exclusion of Dada from the team, Shah Rukh Khan dedicated his team's victory to Sourav Ganguly."} 
      } 
     }, 
       { 
      "Role": {"@FormalName": "Keywords"}, 
      "ContentItem":   { 
      "MediaType": {"@FormalName": "Text"}, 
      "DataContent": {"media-keyword": "Sourav Ganguly, Shah Rukh Khan, KKR, IPL"} 
      } 
     }, 
       { 
      "Role": {"@FormalName": "Photo"}, 
      "ContentItem":   { 
      "@Href": "http://timesofindia.indiatimes.com/photo.cms?photoid=7954812&phototype=1&width=400&height=300", 
      "MediaType": {"@FormalName": "Photo"}, 
      "Format": {"@FormalName": "JPEG Baseline"}, 
      "Characteristics":    [ 
          { 
       "@FormalName": "Width", 
       "@Value": "450" 
       }, 
          { 
       "@FormalName": "Height", 
       "@Value": "300" 
       } 
      ] 
      } 
     }, 
       { 
      "Role": {"@FormalName": "Photo-Caption"}, 
      "ContentItem":   { 
      "MediaType": {"@FormalName": "Text"}, 
      "DataContent": {"media-caption": "Kolkata Knight Riders owner Saha Rukh Khan greets his supporters during their IPL match against Deccan Chargers at Eden Gardens. (PTI photo)"} 
      } 
     }, 
       { 
      "Role": {"@FormalName": "Thumb"}, 
      "ContentItem":   { 
      "@Href": "http://timesofindia.indiatimes.com/thumb.cms?photoid=7954812", 
      "MediaType": {"@FormalName": "Photo"}, 
      "Format": {"@FormalName": "JPEG Baseline"} 
      } 
     }, 
       { 
      "Role": {"@FormalName": "Story"}, 
      "ContentItem":   { 
      "MediaType": {"@FormalName": "Text"}, 
      "DataContent": {"body": {"body.content": "KOLKATA: Aware of the negative vibes in Kolkata after the exclusion of local boy Sourav Ganguly from the team, Kolkata Knight Riders co-owner Shah Rukh Khan on Monday night dedicated his team's nine-run victory to Sourav Ganguly and the sports loving people of the city.\n\nI came back only for the fans. I wanted to do this for Knight Riders, the fans of Kolkata, I wanted to do this for Sourav Ganguly.\n\nI want my team KKR to win the IPL for Kolkata and Sourav Ganguly, said the matinee idol.\n\nI am very happy. It was really a cool moment. (Skipper Gautam) Gambhir and (Jacques) Kallis were really cool. It was really a cool moment as our team is unused to wins, said Shah Rukh Khan after KKR clinched their first win in IPL edition four.\n\nShah Rukh also expressed his disappointment over unnecessary controversies revolving the team for the last three seasons.\n\nA win is always welcome. We had lot of unnecessary controversies in the last three seasons, said Shah Rukh. "}} 
      } 
     } 
     ] 
    }, 
     } 
] 
+0

어쩌면 당신의 질문에 더 구체적이어야합니다 ... –

답변

0

JSON은 잘못된 체크 아웃 http://www.jsonlint.com/

변경된 JSON에서

{ 
    "NewsML": [ 
     { 
      "Identification": { 
       "NewsIdentifier": { 
        "ProviderId": "timesofindia.com", 
        "NewsItemId": "7954765" 
       } 
      }, 
      "NewsLines": { 
       "HeadLine": "I want KKR to win for Ganguly: Shah Rukh", 
       "DateLine": "IANS, Apr 12, 2011, 04.41am IST" 
      }, 
      "NewsComponent": [ 
       { 
        "Role": { 
         "@FormalName": "WebURL" 
        }, 
        "ContentItem": { 
         "MediaType": { 
          "@FormalName": "Link" 
         }, 
         "DataContent": { 
          "media-caption": "http://timesofindia.indiatimes.com/sports/cricket/ipl-2011/news/I-want-KKR-to-win-for-Ganguly-Shah-Rukh/articleshow/7954765.cms" 
         } 
        } 
       }, 
       { 
        "Role": { 
         "@FormalName": "Caption" 
        }, 
        "ContentItem": { 
         "MediaType": { 
          "@FormalName": "Text" 
         }, 
         "DataContent": { 
          "media-caption": "Aware of the negative vibes in Kolkata after the exclusion of Dada from the team, Shah Rukh Khan dedicated his team's victory to Sourav Ganguly." 
         } 
        } 
       }, 
       { 
        "Role": { 
         "@FormalName": "Keywords" 
        }, 
        "ContentItem": { 
         "MediaType": { 
          "@FormalName": "Text" 
         }, 
         "DataContent": { 
          "media-keyword": "Sourav Ganguly, Shah Rukh Khan, KKR, IPL" 
         } 
        } 
       }, 
       { 
        "Role": { 
         "@FormalName": "Photo" 
        }, 
        "ContentItem": { 
         "@Href": "http://timesofindia.indiatimes.com/photo.cms?photoid=7954812&phototype=1&width=400&height=300", 
         "MediaType": { 
          "@FormalName": "Photo" 
         }, 
         "Format": { 
          "@FormalName": "JPEG Baseline" 
         }, 
         "Characteristics": [ 
          { 
           "@FormalName": "Width", 
           "@Value": "450" 
          }, 
          { 
           "@FormalName": "Height", 
           "@Value": "300" 
          } 
         ] 
        } 
       }, 
       { 
        "Role": { 
         "@FormalName": "Photo-Caption" 
        }, 
        "ContentItem": { 
         "MediaType": { 
          "@FormalName": "Text" 
         }, 
         "DataContent": { 
          "media-caption": "Kolkata Knight Riders owner Saha Rukh Khan greets his supporters during their IPL match against Deccan Chargers at Eden Gardens. (PTI photo)" 
         } 
        } 
       }, 
       { 
        "Role": { 
         "@FormalName": "Thumb" 
        }, 
        "ContentItem": { 
         "@Href": "http://timesofindia.indiatimes.com/thumb.cms?photoid=7954812", 
         "MediaType": { 
          "@FormalName": "Photo" 
         }, 
         "Format": { 
          "@FormalName": "JPEG Baseline" 
         } 
        } 
       }, 
       { 
        "Role": { 
         "@FormalName": "Story" 
        }, 
        "ContentItem": { 
         "MediaType": { 
          "@FormalName": "Text" 
         }, 
         "DataContent": { 
          "body": { 
           "body.content": "KOLKATA: Aware of the negative vibes in Kolkata after the exclusion of local boy Sourav Ganguly from the team, Kolkata Knight Riders co-owner Shah Rukh Khan on Monday night dedicated his team's nine-run victory to Sourav Ganguly and the sports loving people of the city.\n\nI came back only for the fans. I wanted to do this for Knight Riders, the fans of Kolkata, I wanted to do this for Sourav Ganguly.\n\nI want my team KKR to win the IPL for Kolkata and Sourav Ganguly, said the matinee idol.\n\nI am very happy. It was really a cool moment. (Skipper Gautam) Gambhir and (Jacques) Kallis were really cool. It was really a cool moment as our team is unused to wins, said Shah Rukh Khan after KKR clinched their first win in IPL edition four.\n\nShah Rukh also expressed his disappointment over unnecessary controversies revolving the team for the last three seasons.\n\nA win is always welcome. We had lot of unnecessary controversies in the last three seasons, said Shah Rukh. " 
          } 
         } 
        } 
       } 
      ] 
     } 
    ] 
} 
0

을 이미지를 표시 할 수 있습니까? 어쩌면 내가 잘못 이해 했겠지만, PHP로 json_decode()로 파싱 할 수있다.

또한 PHP에서 JSON 출력을 JQuery로 구문 분석하고 이미지를 HTML DOM에 추가 할 수 있습니다.

관련 문제