Questions tagged as 'json'

2
answers

How to change the PHP DateTime JSON serialization format?

In PHP, when I use a json_encode in an object of type DateTime , it has the following result: $date = new DateTime(); echo json_encode(compact('date'), JSON_PRETTY_PRINT); Output: { "date": { "date": "2018-08-09...
asked by 09.08.2018 / 19:01
2
answers

Simple quotes are allowed in JSON?

Can I represent a JSON object in this way? { 'helloWorld': true }     
asked by 10.03.2017 / 18:51
1
answer

json_encode - Invalid JSON

I created a PHP code to fetch information from a database (MySQL) and "transform" into JSON. I used json_encode to do this. The output JSON seemed to be correct, but when I use some JSON validator, it always returns a Unexpected token...
asked by 14.10.2014 / 15:28
1
answer

How to return multiple JSON messages via PHP, each one being triggered at different times?

I'm building a system and at one stage it saves 3 sets of information filled out on the form by the system operator: Set 1: student information; Set 2: student guarantor information; Set 3: information about student enrollment. I am m...
asked by 15.12.2013 / 22:43
2
answers

How to consume this JSON with JavaScript?

How do I consume this URL using JavaScript?    > link     
asked by 15.02.2016 / 16:21
2
answers

Get the value of the javaScript table and put it in an array

I have a problem, I made a PivotTable in JavaScript and want to throw your data into an array, I tried using JSON but when I click the button to run the event it does nothing. I do not know if a plugin is missing, since I have never worked with...
asked by 16.11.2015 / 14:35
2
answers

Failed to compare dates before writing to bank

I'm trying to do a date validation, if the date DataInicial is less than DataAtual , ie it can not be retroactive the script should return me an error message with json_encode not allowing the stream continue, which is not ha...
asked by 12.11.2015 / 18:29
2
answers

JSONArray in JSONObject: Json.typeMistach error

In a web-based search I discovered that the Json.typeMistach error was due to me getting a JSONArray and trying to get it in a JSONObject . I can not fix it, the error persists. Could someone give me a hand or point me to a tu...
asked by 10.09.2015 / 04:24
2
answers

How to perform insert or update of a JSON object

JSON object $postdata : { "0": { "codigo": "1", "descricao": "Bobina", "preco": "10.0000" }, "1": { "codigo": "2", "descricao": "Capa", "preco": "20.0000" } } Using MySQL...
asked by 14.02.2017 / 18:43
2
answers

Deserialize Json string [] to string []

I have the following JSON : {"TicketID":["116","114","112","108","107","104","102"]} When I try to deserialize to string[] I get the error:    Server Error in Application '/'.       No constructor without parameters   was...
asked by 22.12.2017 / 19:14