本文介绍了为什么json_encode转义正斜杠(/)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面的函数参数是贯穿json_encode()的字符串.我看到http://中的正斜杠转义为http:\/\/.显然,当像<some_tag></some_tag>这样使用时,它是一个特殊字符,但仅当在该结构中使用时.

The function argument below is a string run through json_encode(). I see that the forward slash in http:// is escaped to http:\/\/.Obviously it is a special character when used like this <some_tag></some_tag> but only when used in that structure.

没有直接的问题..但是我需要了解转义符以进行一些代码更新.

There is no immediate problem..but I need to understand escapes to make some code updates.

<script type='text/javascript'>Arc.ViewHBookmark('[{"id":"1","0":"1","title":"cybercoders","1":"cybercoders","url":"http:\/\/cybercoders.com","2":"http:

php.net- json_encode

相关

JSON:为什么要转义正斜杠?

推荐答案

它就像HTML文档的<script>元素中嵌入的JSON的</endtag>结构的安全网一样.

It is just as a safety net for the </endtag> structure for JSON embedded in <script> elements in HTML documents.

没有其他意义.

这篇关于为什么json_encode转义正斜杠(/)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-20 23:17