santBart
santBart

Reputation: 2496

Send json from android - server side

I need php script for server side to read json sent from android and to update database with received data. Can anyone help me? I don't know php to much, but need script for yesterday;) Thanks for help in advance.

Upvotes: 0

Views: 355

Answers (1)

user823255
user823255

Reputation: 1010

You can decode the json String into an Object with the php function json_decode http://www.php.net/json_decode

<?php
if (isset($_REQUEST['parameter']) {
    $json = json_decode($_REQUEST['parameter']); // gives you a php object
    var_dump( $json );
}
else 
    echo "No data received."
?>

Upvotes: 2

Related Questions