首页 > 解决方案 > JSON - 网络路径中的反斜杠

问题描述

我有一个返回这个 JSON 的 PHP api:

{
    "recrutee": {
        "recrutee_nom": "Mustermann",
        "recrutee_statut": "Extern",
        "recrutee_id_iam": "APP764",
        "recrutee_debut_de_contrat": "2018-08-30",
        "recrutee_fin_de_contrat": "2018-11-29",
        "recrutee_prenom": "Max"
    },
    "responsable": {
        "responsable_nom": "Musterman",
        "responsable_prenom": "Marc",
        "responsable_tel": "66666666",
        "responsable_service": "It",
        "responsable_email": "example@example.com"
    },
    "acces_reseau": [{
        "path": "\\Some\Network\Path"
    }],
    "option_pc": [
        {
            "autre": "Nfc Reader"
        }, {
            "option": "internet"
        }, {
            "option": "lecteurluxtrust"
        }, {
            "option": "scanner"
        }, {
            "option": "imprimante"
        }, {
            "option": "ecransupplementaire"
        }, {
            "option": "lectuercodebarres"
        }
    ],
    "demande_id": "5b54588d00772",
    "lieu": "Luxembourg City"
}

问题在于网络路径是否需要如下所示:

\\\\Some\\Network\\Path

由于反斜杠用作转义字符,因此我的原始 json 中的网络路径不正确。

是否有任何以编程方式(非手动)方式获得此结果:

\\\\Some\\Network\\Path

标签: json

解决方案


推荐阅读