json_encode is a PHP function that converts a PHP value into a UTF-8 JSON encoded string.

learn more… | top users | synonyms

2
votes
0answers
96 views

fasterxml jackson objectmapper convert string

my string is: json = {"foo":"bar"}{"foo":"bar"} ======================== ObjectMapper mapper = new ObjectMapper(); JsonNode jsonNode = null; try { final JsonParser jParser = ...
2
votes
0answers
116 views

Is php's json_encode() vulnerable when embedded in a script element?

I had read OWASP's XSS Prevention Cheat Sheet a long time ago and made a wrapper function to include JSON_HEX_TAG|JSON_HEX_APOS|JSON_HEX_QUOT|JSON_HEX_AMP by default so I would be safe. Or so I ...
2
votes
0answers
1k views

Prestashop Web service to return JSON

After extensive search over internet i am sure that Prestashop does not return data in JSON format, it only returns in XML format (which leads to cross domain accessing issue unfortunately). Now, I ...
1
vote
0answers
28 views

Cakephp -how to use and where to put debug($var) in $this?

I want to know the value of the associative array $this in cakephp, base on my research I could use debug($this); however I don't know where to put it, model, view or controller, and I don't know ...
1
vote
0answers
48 views

how to parse json data without semiquotes

Hello i am trying to build a map using php json, when i tried to pass the value to javascript it is showing error Uncaught SyntaxError: Unexpected token a { "map": "worldLow", ...
1
vote
0answers
36 views

How may i retrieve Mysql data to this JSON format?

I have read about json_encode but still lack the logic in using it for my needs on this particular JSON structure. Assuming the JSON structure is as follows : { "_id": "23441324", "api_rev": ...
1
vote
0answers
264 views

OData [JsonConverter] attribute serialization

I am trying to use the default .Net serialization methods when serving OData via EntitySetController. When using: [DataContract] public class TestClassA { public int Id { get; set; } public ...
1
vote
0answers
76 views

Draw AreaChart with google grpah api using json data

i have a json array in the following format which i get in a ajax response {"graph":[{"date_display":"2013-12-26","ticketss_sold_on_date":"3","money_earned":"468"}]} the google api javascript part ...
1
vote
0answers
122 views

Access json data using jquery (returned by php)

Q1.here is my html: <html> <head> <title> Runners </title> </head> <body> <button id="printrunners"> Print Runners</button> <div ...
1
vote
0answers
56 views

Changing JSON array to get smaller messages?

When using JSON to send an array of objects from the same class the objects fields are repeated many times, often unnecessarily, and the message becomes very long for arrays with big length. To my ...
1
vote
0answers
137 views

New lines with tinymce editor, issue when decode in PHP

I am using tinymce editor to edit some content and store the value in a JSON object in a property and using JSON.parse(JSONObject) to post the value to server. In server-side when I decode the JSON ...
1
vote
0answers
870 views

PHP Warning: json_encode(): Invalid UTF-8 sequence

I'm using PHP to populate my DataTables select boxes. If I add a new entry using the DataTables page (clicking in the 'Add' button), I have no problem with the accents (special characters), but if I ...
1
vote
0answers
272 views

if json_encode a string contains (&quot;) in phtml, the browser will change it's construction,how to prevent it?

php:5.3.3 jquery:1.7.2 here is the way we use to send the value from php to jquery. get the escaped string. $a = '&quot;xxxxx'; $b = json_encode($a); and now, $b is '"xxxxx'; put $a ...
1
vote
0answers
143 views

“Warning: json_encode()” in common.inc

When I access a view, and try to edit/add a field, the overlay shows up but without any content. Afterwards I always get the following warning: Warning: json_encode(): Invalid UTF-8 sequence in ...
1
vote
0answers
123 views

JQuery Validate fails when Boolean value is quoted by json_encode

I found a problem from using json_encode to create a string to pass as metadata to JQuery Validate (bassistance version): it encloses Booleans in quotes which JQuery Validate does not like. Here is ...
1
vote
0answers
160 views

Pass JSON encoded Array through AJAX as POST

What I want: I want to pass a PHP Array to a PHP backend file through AJAX POST method. What I am doing: I am encoding the array with json_encode() and passing it as a POST element with the ...
1
vote
0answers
131 views

how to encoding json request to post to REST server

I need to call the API method "newPhoto" REST web service to post new photo to a specific client. The "newPhoto" method is defined as below: method=newPhoto Request example in JSON: ...
1
vote
0answers
73 views

Json_encode returns string in parts

I have a php array wich looks like this: Array ( [0] => rgb(255, 126, 28) [1] => rgb(255, 126, 28) [2] => rgb(255, 126, 28)... And I want to pass it through jason_encode, but the problem ...
0
votes
0answers
20 views

How do you put an authentication token on URL as query parameter?

I'm doing a PayPal Express Checkout on my ASP.Net MVC site. The site uses token authentication so I'm trying to put the token on the PayPal return URL as a query parameter. I have a handler that ...
0
votes
0answers
15 views

Sending a post request with AFNNetworking returning an error:unacceptable content-type: text/html

Im trying now for 2 days to make a post request to my API (which i made with Laravel) with AFNNetworking but somehow i'm getting the following error: (JSON text did not start with array or object ...
0
votes
0answers
16 views

android - read arabic from local json file

please someone help me , i try read arabic string from json file the code i use it , i try read multi-lines of arabic language public String loadJSONFromAsset() { String json = null; ...
0
votes
0answers
54 views

php json_encode retuns false

I've got this object. This is the var_dump of my object: object(stdClass)#2 (3) { ["status"]=> bool(true) ["sql"]=> string(122) "SELECT * FROM `story`" ["story"]=> array(12) { ...
0
votes
0answers
37 views

Assocative array to php table

I have json encoded string which I'm converting to php/html table but its not working. All data should come in text files error in foreach : invalid argument html should be: id text ...
0
votes
0answers
25 views

Scala json not playing nicely with base64 encode

I'm simulating sending a JSON request ~500kb. The test isn't testing what's in the request simply testing the load a JSON request of this size would place on server. Code is as follows: val values = ...
0
votes
0answers
38 views

Passing xml to url

Im new to xml and i just want to pass an object to url and parse it to array . dont know what to do. Here's my code: $xml = ...
0
votes
0answers
39 views

Remove Quotes from json_encoded string value

so im working on a project to implement jTable into a PHP framwework class. Its going quit well. Now im stuck at a problem where I would like to be able to make custom input fieds on the edit dialog. ...
0
votes
0answers
25 views

How to pars data from json using the IDs of objects?

I have this json URL I used the code below to pars data but there is an extra data when I add the ID of some object to the URL .. my question is how to pars that extra data to new activity ?? thanks ...
0
votes
0answers
43 views

PHP mysql How to split a string before a special character that lies before the end of the desired new substring?

Ive encountered a weird problem when outputting an array using json_encode($string). This problem arises if I call $name = mb_substr($name, 0, 100); and the last character (at $name[100]) happens to ...
0
votes
0answers
28 views

json_encode/decode not working as expected

i am trying to develop a php based flashcard app. When adding cards to the database (file based, not mySQL) I would like to have the data stored in a file as a an array using JSON. The procedure I am ...
0
votes
0answers
86 views

JSON to PHP array / Empty json

So I have a php file which generates json data based on different "params" .php?params=foo,bar,blaa (some sort of API?) I have checked it, and it returns valid json data. Mostly I'm ...
0
votes
0answers
27 views

MultiJson oj to render json in rails - Performance issue

I am trying to create JSON using multijson and oj. I have big data coming from the database which is around 20000 records with each query. Query proformance is fine but when I am creating json object ...
0
votes
0answers
53 views

using php resulting into nested json

I hope SO will help me with this. For last few days I have been trying to work on a query but not getting correct solution. I am having a query as below $sql = "SELECT m.MarkID, ...
0
votes
0answers
28 views

why does json_decode break when passed specific strings?

here is my function in a class called getminecraftprofile.php basically it takes data from https://sessionserver.mojang.com/session/minecraft/profile/ dependant on the UUID of the user and gets an ...
0
votes
0answers
43 views

JSON sort by key which is in second level

Hi is there any way to sort JSON before parsing? i want to sort by OutcomeDateTime. This is my JSON { "State of Origin 2014":{ "1471137":{ "EventID":1471137, ...
0
votes
0answers
22 views

Multidimensional array on json_encode php and after that accessing using javascript

I need to have access to arrCountResult. File .php: ... $arrCountResult = $em->getRepository('myvoteusuariosBundle:Answer') ->findAllAnswerByVote($id_vote); ...
0
votes
0answers
36 views

PHP json_encode() returns nothing using dataTables and MWS Theme

what I'm doing wrong here. I'm trying to send the json_encode to a dataTables, using a MWS Themeforest Theme. Here is my ajax code: <?php include("../inc/connect.inc.php"); ...
0
votes
0answers
26 views

Get Data From Json file into Php

hi im trying to get data from json file using php with a url query eg http://192.168.1.104/testing_JSON/zjson2.php?name=nas The following is my code i dont know the syntax to use for retrieving the ...
0
votes
0answers
46 views

Changing PHP5 code to PHP4 code but getting errors

Hello I am working in my company project where i previously developed code on PHP5. And it was working fine. But now for some issues they want me to develope this migrate or change the same code into ...
0
votes
0answers
16 views

json_encode() returns blank string only when debugging through netbeans 8.0

I developed a jQuery code which makes ajax request to the PHP and returns json output. I have executed this code hundreds of times and it works fine. Today I wanted to debug my code using Netbeans and ...
0
votes
0answers
30 views

Decode json file android

At the moment, i have a response receive from server. [["SIR\u30eb\u30fb\u30da\u30bf\u30a6\u30b4\u30eb\u30d5\u30b3\u30fc\u30b9"],["KOSHIGAYA\u3000GOLF\u3000CLUB"],["TOKYO North Hills GolfCourse ...
0
votes
0answers
113 views

Failed to decode VALUE_STRING as base64 (MIME-NO-LINEFEEDS)

I'm trying to upload image with some text and number type in html form. In the front end i use angularjs and rest jersey in the backend. my problem is when i try to persist my object "Vehicule" witch ...
0
votes
0answers
121 views

How to consume the POST method of WCF REST service in PHP?

I have a WCF REST enabled service which contains a POST method contract. This contract takes a class object having properties Name,Salary,Image to be passed from the php client.I have created my php ...
0
votes
0answers
108 views

Ajax call of php function does not send json array

This javascript calls a php function through ajax with json datatype. The data returned from php should be a json array with three items: html, todays_events, debug_text. On linux the json returned ...
0
votes
0answers
15 views

php json_decode giving bad object key = (value)

Im using PHP and decoding an object, but the object is getting decoded as this: { "in_app" = ( { "is_trial_period" = false; ...
0
votes
0answers
47 views

Weird issue with json encode

I have charset=utf8 set as a parameter for my PDO connection. When I try to json_encode an array I get back, for some reason it returns a bunch of �͝�� characters. However, if I print_r the array ...
0
votes
0answers
51 views

Between is working fine in SQL Server but losing starting date while fetching same query through PHP

I am having a weird problem: I fired the same query select DateSpan, PUE from GF.dbo.PUE Data where DateSpan between '2013-10-01 12:00:00.000' and '2013-10-31 12:00:00.000' in SQL Server and getting ...
0
votes
0answers
27 views

Images not loading on iPhone when pulled in via array & json_encode

I'm using jQuery (Backstretch) to load a full screen image slideshow, and pulling in images from content uploaded via custom meta boxes by building an array in php and echoing the links using ...
0
votes
0answers
26 views

PHP array value sometimes null, sometimes same array value not null

I am basically making game statistics, game server reports to my php script, the script is supposed to log statistics and create db record. Example report (valid json) http://pastebin.com/rugHavwt ...
0
votes
0answers
11 views

json_encode not able to display long sentences or text/string

this is my link which is returing me a json array but few values in this json are beiong returned null for eg. jsokeoftheday or thoughtoftheday eg: thought of the day is 7. If a person wants to be a ...
0
votes
0answers
199 views

Internal Server Error - php json_encode

i have some trouble to get the dataflow between my javascript and my php working... somehow i myself or something in my code is messing up things with how to use JSON. Following is my jquery ajax ...