这一个数据怎样解析,该如何处理
这一个数据怎样解析
我用了json
但是输不出来动西,
当然也无法操作了。
我主要是想得到data[]里面每一个数据。比如
我想得到。og_id 我应该怎么操作呢????
public function getJson($url){
$str = file_get_contents($url);
$data = json_decode($str,true);
echo "
";print_r($data);exit();<br> return $data;<br> }<br><br>在浏览器里找打开连接是这样的。<br><br>
- Java code
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->SINAFINANCE132436359014192800(({data:[{og_id:"1061971",contest_id:"8",sid:"2096647540",StockCode:"sz002230",StockName:"科大讯飞",SellBuy:"0",OrderPrice:"34.700",DealAmount:"4200",OrderAmount:"4200",IfDealt:"1",OrderTime:"2011-10-25 09:58:44",mtime:"2011-10-25 09:58:44",remark:""}],count:"100"}))
------解决方案--------------------
你这个不是json来的
------解决方案--------------------
这是jsonp
------解决方案--------------------
http://api.jquery.com/jQuery.getJSON/
------解决方案--------------------
1、不知道你的这个串是从哪里来的,因为你没给出出处
2、不知道什么是 jsonp,但此串显然不符合那个连接中的描述
3、但我知道这是一个js指令,他通过先前已加载过的 SINAFINANCE132436359014192800 函数进行某个操作。
4、我还知道,传递的 json 串是微软系列语言使用的标准格式:键名没有双引号
这种格式的 json 不能被目前 php 的内置函数所接受,不能不说是个败笔
js 分析
- JScript code
<script> function SINAFINANCE132436359014192800(v) { for(t in v) { if(typeof(v[t]) == 'object') SINAFINANCE132436359014192800(v[t]) document.write(t + ':'+v[t]+'<br>'); } } SINAFINANCE132436359014192800(({data:[{og_id:"1061971",contest_id:"8",sid:"2096647540",StockCode:"sz002230",StockName:"科大讯飞",SellBuy:"0",OrderPrice:"34.700",DealAmount:"4200",OrderAmount:"4200",IfDealt:"1",OrderTime:"2011-10-25 09:58:44",mtime:"2011-10-25 09:58:44",remark:""}],count:"100"})) </script> <br><font color="#e78608">------解决方案--------------------</font><br>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The combination of golangWebSocket and JSON: realizing data transmission and parsing In modern Web development, real-time data transmission is becoming more and more important. WebSocket is a protocol used to achieve two-way communication. Unlike the traditional HTTP request-response model, WebSocket allows the server to actively push data to the client. JSON (JavaScriptObjectNotation) is a lightweight format for data exchange that is concise and easy to read.

The Gson@Expose annotation can be used to mark whether a field is exposed (contained or not) for serialization or deserialization. The @Expose annotation can take two parameters, each parameter is a boolean value and can take the value true or false. In order for GSON to react to the @Expose annotation, we have to create a Gson instance using the GsonBuilder class and need to call the excludeFieldsWithoutExposeAnnotation() method, which configures Gson to exclude all fields without Expose annotation from serialization or deserialization. Syntax publicGsonBuilderexclud

MySQL5.7 and MySQL8.0 are two different MySQL database versions. There are some main differences between them: Performance improvements: MySQL8.0 has some performance improvements compared to MySQL5.7. These include better query optimizers, more efficient query execution plan generation, better indexing algorithms and parallel queries, etc. These improvements can improve query performance and overall system performance. JSON support: MySQL 8.0 introduces native support for JSON data type, including storage, query and indexing of JSON data. This makes processing and manipulating JSON data in MySQL more convenient and efficient. Transaction features: MySQL8.0 introduces some new transaction features, such as atomic

Performance optimization methods for converting PHP arrays to JSON include: using JSON extensions and the json_encode() function; adding the JSON_UNESCAPED_UNICODE option to avoid character escaping; using buffers to improve loop encoding performance; caching JSON encoding results; and considering using a third-party JSON encoding library.

Quick Start: Pandas method of reading JSON files, specific code examples are required Introduction: In the field of data analysis and data science, Pandas is one of the important Python libraries. It provides rich functions and flexible data structures, and can easily process and analyze various data. In practical applications, we often encounter situations where we need to read JSON files. This article will introduce how to use Pandas to read JSON files, and attach specific code examples. 1. Installation of Pandas

Annotations in the Jackson library control JSON serialization and deserialization: Serialization: @JsonIgnore: Ignore the property @JsonProperty: Specify the name @JsonGetter: Use the get method @JsonSetter: Use the set method Deserialization: @JsonIgnoreProperties: Ignore the property @ JsonProperty: Specify name @JsonCreator: Use constructor @JsonDeserialize: Custom logic

Use the json.MarshalIndent function in golang to convert the structure into a formatted JSON string. When writing programs in Golang, we often need to convert the structure into a JSON string. In this process, the json.MarshalIndent function can help us. Implement formatted output. Below we will explain in detail how to use this function and provide specific code examples. First, let's create a structure containing some data. The following is an indication

How to handle XML and JSON data formats in C# development requires specific code examples. In modern software development, XML and JSON are two widely used data formats. XML (Extensible Markup Language) is a markup language used to store and transmit data, while JSON (JavaScript Object Notation) is a lightweight data exchange format. In C# development, we often need to process and operate XML and JSON data. This article will focus on how to use C# to process these two data formats, and attach
