将PHP(JSON)转换为ASP代码
有人能把下面的代码转换成ASP格式吗将PHP(JSON)转换为ASP代码,php,json,asp-classic,Php,Json,Asp Classic,有人能把下面的代码转换成ASP格式吗 <?php $data = ' [ { "A": "test", "B": "test", "C": "test" }, { "A": "test", "B": "test", "C": "test" } ] '; print($_GET['callback'] .'('. $data .')'); 比如,一次 如果无论如何都要打印所有字符串,则可以避免整个字符串连接业务(例如,
<?php
$data = '
[
{
"A": "test",
"B": "test",
"C": "test"
},
{
"A": "test",
"B": "test",
"C": "test"
}
]
';
print($_GET['callback'] .'('. $data .')');
比如,一次
如果无论如何都要打印所有字符串,则可以避免整个字符串连接业务(例如,在变量中没有进一步的用途):
[
{
“A”:“测试”,
“B”:“测试”,
“C”:“测试”
},
{
“A”:“测试”,
“B”:“测试”,
“C”:“测试”
}
]
再次感谢。你真让我高兴。我更正了上面的代码示例。我在那里犯了一个小错误
<%
Dim data
''// VBScript Strings cannot span multiple lines, we must use
''// concatenation ("&") and line continuation markers ("_")
''// (also, double quotes need to be escaped by *double* double quotes)
data = "" & _
"[" & _
" {" & _
" ""A"": ""test""," & vbCrLf & _
" ""B"": ""test""," & vbCrLf & _
" ""C"": ""test""" & vbCrLf & _
" }," & vbCrLf & _
" {" & vbCrLf & _
" ""A"": ""test""," & vbCrLf & _
" ""B"": ""test""," & vbCrLf & _
" ""C"": ""test""" & vbCrLf & _
" }" & vbCrLf & _
"]"
Response.Write Request.QueryString("callback") & "(" & data & ")"
%>
<%
Response.Write Request.QueryString("callback") & "("
%>
[
{
"A": "test",
"B": "test",
"C": "test"
},
{
"A": "test",
"B": "test",
"C": "test"
}
]
<%
Response.Write ")"
%>