Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9001759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:28:45+00:00 2026-06-16T00:28:45+00:00

I am having trouble parsing data sent to a php webservice. I am using

  • 0

I am having trouble parsing data sent to a php webservice. I am using the following code to get the json:

$decoded = json_decode(file_get_contents('php://input'));
if(is_null($decoded) == NULL)
    {
        $body = "Data was not successfully received";
        $body = $body . "      " . $jsonInput;
    }

The json is sent from an iOS application and looks like the following:

{
  "water" : "YES",
  "int_clean" : "YES",
  "ceiling_stains" : "YES",
  "additional_comments" : "not entered",
  "roof_cond" : "YES",
  "e_clean" : "YES",
  "interior_cond" : "not entered",
  "no_exp" : "not entered",
  "addr" : "YES",
  "roof_leak" : "YES",
  "doors_sec" : "YES",
  "elec" : "YES",
  "ceiling_exp" : "not entered",
  "repaired" : "YES",
  "o_desc" : "not entered",
  "w_sign" : "YES",
  "o_cond" : "not entered",
  "int_cond" : "YES",
  "gas" : "YES",
  "for_sale_sign" : "YES",
  "sold_as_is" : "YES",
  "mb_sign" : "YES",
  "graffiti" : "YES",
  "date" : "18-12-2012 18:58",
  "dewinterized" : "YES",
  "HVAC" : "YES",
  "why_no_mat" : "not entered",
  "is_lockbox" : "YES",
  "financing_mat" : "YES",
  "yard_cond" : "YES",
  "marketing_mat" : "YES",
  "HVAC_missing" : "not entered",
  "agent_info" : "YES",
  "e_cond" : "YES",
  "e_key" : "YES",
  "pool_sec" : "YES",
  "pool_clean" : "YES"
}

And sending it with this code:

 NSDictionary * info = [NSDictionary dictionaryWithObjects:values forKeys:keys];
NSData* jsonData = [NSJSONSerialization dataWithJSONObject:info options:NSJSONWritingPrettyPrinted error:&error];

NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://uofi-bars.com/sendEmail.php"]];
[req addValue:@"Content-Type: application/json" forHTTPHeaderField: @"Content-Type"];
[req setHTTPMethod:@"POST"];
[req setHTTPBody:jsonData];


[NSURLConnection sendSynchronousRequest:req returningResponse:&response error:&error];

I am completely new to php and this has been giving me a headache for quite some time. Any help would be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T00:28:46+00:00Added an answer on June 16, 2026 at 12:28 am

    This is not correct if(is_null($decoded) == NULL). PHP is_null returns a boolean value. So you need to be using if(is_null($decoded) === FALSE) or if(is_null($decoded) === TRUE).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble parsing my JSON which i get from javascript. The format
I'm having trouble in parsing my JSON data in jQuery autocomplete. My JSON comes
I'm trying to use PHP to process JSON and am having trouble parsing it
i'm still transitioning from as2 to as3, i'm having trouble with parsing XML data
I'm having some trouble parsing malformed XML in PHP. In particular I'm querying a
I'm having some trouble parsing a JSON that I obtain from my DB to
I'm having trouble with PHP text parsing I have a txt file which has
I am playing around with parsing JSON in jQuery and I am having trouble.
I'm having some trouble with Java's Calendar. I'm parsing some data from a txt
I'm having trouble using vq.whiten from scipy.cluster to normalise my data. I'm passing in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.