drtzb06222
2019-07-09 11:39
浏览 124
已采纳

使用php格式化JSON到wordpress中的html [关闭]

I have an api that returns this

{
    "success": true,
    "data": {
        "medicineId": 15,
        "medicineName": " Alectinib",
        "medicineDescription": "Alectinib is a second generation oral drug that selectively inhibits the activity of anaplastic lymphoma kinase (ALK) tyrosine kinase. It is specifically used in the treatment of non-small cell lung cancer (NSCLC) expressing the ALK-EML4 (echinoderm microtubule-associated protein-like 4) fusion protein that causes proliferation of NSCLC cells. Inhibition of ALK prevents phosphorylation and subsequent downstream activation of STAT3 and AKT resulting in reduced tumour cell viability.

Approved under accelerated approval in 2015, alectinib is indicated for use in patients who have progressed on or were not tolerant of crizotinib, which is associated with the development of resistance.",
        "sideEffects": "tiredness . 
constipation . 
swelling in your hands,feet,ankles,face .
muscle pain , tenderness and weakness (myalgia) .
low red blood cell count (anemia) .",
        "chemicalFormula": "
C30H34N4O2",
        "indication": "Alectinib is a kinase inhibitor indicated for the treatment of patients with anaplastic lymphoma kinase (ALK)-positive, metastatic non-small cell lung cancer (NSCLC) who have progressed on or are intolerant to crizotinib. This indication is approved under accelerated approval based on tumor response rate and duration of response. Continued approval for this indication may be contingent upon verification and description of clinical benefit in confirmatory trials.",
        "associatedCondition": "Refractory, metastatic Non small cell lung cancer",
        "alternatives": [
            {
                "medicineId": 10,
                "medicineName": "Alclometasone"
            }
        ],
        "categories": [
            "BCRP/ABCG2 Inhibitors",
            "Antineoplastic and Immunomodulating Agents",
            " Antineoplastic Agents"
        ]
    },
    "message": "Successfully retrieved"
}

I want to format that to look good in a popup Any idea how i can do that?

图片转代码服务由CSDN问答提供 功能建议

我有一个api返回此

  {
  “成功”:真实,
“数据”:{
“medicineId”:15,
“medicineName”:“Alectinib”,
“”医学描述“:”Alectinib是一种选择性抑制活性的第二代口服药物 间变性淋巴瘤激酶(ALK)酪氨酸激酶。它特别用于治疗表达ALK-EML4(棘皮动物微管相关蛋白样4)融合蛋白的非小细胞肺癌(NSCLC),该融合蛋白可引起NSCLC细胞增殖 抑制ALK可防止磷酸化和随后的STAT3和AKT下游活化,从而导致肿瘤细胞活力降低。
 
 
 
 
在2015年加速批准后,alectinib适用于已经进展或不耐受的患者 克里唑替尼与抗药性的发展有关。“,
”sideEffects“:”疲倦。
 
 
便利。
 
swe 舔你的手,脚,脚踝,脸。
 
muscle疼痛,压痛和虚弱(肌痛)。
 
 
红细胞计数(贫血)。“,
”chemicalFormula“:”
 
C30H34N4O2“  ,“适应症”:“Alectinib是一种激酶抑制剂,适用于治疗间变性淋巴瘤激酶(ALK)阳性,转移性非小细胞肺癌(NSCLC)患者,这些患者已经进展或对克唑替尼不耐受。 根据肿瘤反应率和反应持续时间,在加速批准下批准该适应症。 此指征的持续批准可能取决于确认试验中的临床获益的验证和描述。“,
”associatedCondition“:”难治性,转移性非小细胞肺癌“,
”替代品“:[
 {
  “medicineId”:10,
“medicineName”:“Alclometasone”
} 
],
“类别”:[
“BCRP / ABCG2抑制剂”,
“抗肿瘤和免疫调节剂”,
“ 抗肿瘤药物“
 
”
},
“消息”:“已成功检索”
} 
   
 
 

我想将其格式设置为在 popup 不知道我该怎么做?

  • 写回答
  • 好问题 提建议
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douhui8163 2019-07-09 11:50
    已采纳

    I guess this is what you were looking for:

    <?php
    $contents = 'Your json result here';
    $jsonArray = json_decode($contents,true);
    $medicineId = $jsonArray["medicineId"];
    ?>
    
    <h1> MedicineId: <?php echo $medicineId ?> </h1>
    
    已采纳该答案
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题