Php 将blog post标记与JSON一起使用

Php 将blog post标记与JSON一起使用,php,json,Php,Json,我有一些JSON,如下所示 "tags": { "business-school": { "name": "Business School", "slug": "business-school", "parent": 0, "description": "", "post_count": 13, "id": 169072, "taxonomy": "post_ta

我有一些JSON,如下所示

"tags": 
{
    "business-school": 
     {
        "name": "Business School",
        "slug": "business-school",
        "parent": 0,
        "description": "",
        "post_count": 13,
        "id": 169072,
        "taxonomy": "post_tag"
     },
     "canterbury": 
     {
         "name": "Canterbury",
         "slug": "canterbury",
         "parent": 0,
         "description": "",
         "post_count": 37,
         "id": 5349,
         "taxonomy": "post_tag"

我已经设法显示了与帖子一起输入的相关标签。在其他博客上,我看到标签是超链接的,我想知道这是如何实现的。它们与什么有联系?。记住,我对JSON不是很熟悉,它是JSON框架中可以使用PHP的东西,还是最好留给博客网站使用。

如果你能保持如下数据的关系,那么你也可以在博客文章中使用超链接技术轻松实现该标记

标签格式,其中每个标签将与一个ID关联

所以你的锚链会像-

https://blogs.canterbury.ac.uk/cafa/tag/555/
https://blogs.canterbury.ac.uk/cafa/tag/777/

"tags":
{
    "business-school":
     {
        "name": "Business School",
        "slug": "business-school",
        "parent": 0,
        "description": "",
        "post_count": 13,
        "id": 169072,
        "taxonomy": "post_tag",
        "tag_id": 555
     },
     "canterbury":
     {
         "name": "Canterbury",
         "slug": "canterbury",
         "parent": 0,
         "description": "",
         "post_count": 37,
         "id": 5349,
         "taxonomy": "post_tag",
         "tag_id": 777
    }
}
关于标签ID的博客帖子格式

当用户点击其中任何一个超链接时,您将获得标签ID&从这些标签ID中,您可以使用这些ID标记相应的帖子。Ex-TagID555与2篇帖子相关联

{
    "555": [{
        "blog_id": 111,
        "blog_excerpt": "your blog excerpt",
        "date": "2017-04-15"
    }, {
        "blog_id": 222,
        "blog_excerpt": "your blog excerpt",
        "date": "2017-04-16"
    }],
    "777": [{
        "blog_id": 333,
        "blog_excerpt": "your blog excerpt",
        "date": "2017-04-17"
    }, {
        "blog_id": 444,
        "blog_excerpt": "your blog excerpt",
        "date": "2017-04-18"
    }]
}

希望你能理解我的观点。

在哪一个博客上,你看到的标签是超链接。你能和我们分享这个链接吗?如果你不知道他们会链接到什么,那么这是一个相当简单的问题。首先决定将它们链接到什么,然后再考虑如何链接它们不太清楚您的意思,但是如果您能够显示标签,您可以只向标签添加一个锚,使其链接,例如。至于链接指向什么,则由您定义URL。下面是示例,