Tag Archives: json
How to encode output buffers in json -php
I’m trying to encode an the result of an output buffer in json, but I’m not getting the correct result:
Meu código:
$n=ob_get_flush();
$arr = array('base64' => $n);
echo json_encode($arr);
The result:
xyz{"base64":null}
The hoped result:
{"base64":xyz}
…
Any help would Continue lendo
Backbone.js Collection fetch with initial parameter
Is there any way to fetch a collection by giving an initial model parameter to buscar().
To clear out: I have a model Human with attributes nome (como uma string) e números(disposição)…. I would like to find all Continue lendo
Fetch data from MYSQL and display in JSON file
I’m building and iOS application which fetches data from my MYSQL database,so to do such thing i need to use JSON(i know other methods,but i need specifically to use JSON).O problema é, how can i fetch data from my mysql… Continue lendo
Pare de renderização de layout para solicitação do Ajax com o costume de roteamento
Como posso parar a renderização de layout, quando o envio de solicitação por meio de AJAX..
O problema que enfrentamos é json dados é ecoado na class="IL_AD" , não passou a tha função de chamada de retorno do jquery
aqui está o meu script
jQuery.ajax({
url: "/getPrivileges",
type: "POST",
…
What is the best way to put a Json string in a html tag?
What is the best way to put a json string (encoded php array) into an html tag?
<?php
$content = array(key1=>'value 1', key2=>'value 2');
?>
<span class="someclass" data="<?php echo(json_encode($content)); ?>">Stuff Here</span>
…
This isn’t valid because when it’s encoded it will Continue lendo
Cross-domain pedido getJson com proxy PHP Simples
Hi I’m trying to get data from an api that ONLY returns JSON rather than JSONP. Every time I try to get the data connecting as JSONP it doesn’t work because I am not expecting JSON. Assim, I guess I… Continue lendo
php file with one method
I need help um doing an application on android and I need to make a backend as php file which will write in another file ,
simple file with only one method get data from android application and write it… Continue lendo
Backbone.js: Weird .save() error callback
I get an error response from the .save()… função. The server side php returns me a text and successfully saves the url into database. When I inspect the response I can see the text returned by PHP, however I do Continue lendo
how to post data to URL with php without curl
I have to post to a URL using PHP. right now it works but after the sending data/posting, it gives gives a json output (from the web service i’m posting to) and i need the output to be friendly.
Em… Continue lendo
JSON-data from iOS into PHP-script
How can I access json data within a php-script, which it received via http-post?
I’m doing the following on the iOS-side:
NSData *data = [NSJSONSerialization dataWithJSONObject:object options:0 error:NULL];
NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com/script.php"]];
[req setHTTPMethod:@"POST"];
[req setHTTPBody:data];
[NSURLConnection sendSynchronousRequest:req …





