title: Unable to parse JSON in PHP to find particular value?
body: <p>I am currently having problem searching for a particular value which is new_user in a JSON file that I get using file_get_contents and then I decode it.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
     &lt;link href="styles.css" rel="stylesheet" type="text/css" /&gt;
   &lt;title&gt;PHP Bing&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;&lt;form method="post" action="&lt;?php echo $PHP_SELF;?&gt;"&gt; 
   Type in a search:&lt;input type="text" id="searchText" name="searchText" value=""/&gt;
          &lt;input type="submit" value="Search!" name="submit" id="searchButton" /&gt;
  &lt;?php
  if (isset($_POST['submit'])) {
  $request = 'https://devblogs.instavoice.com/vb?data={"cmd":"join_user","client_os_ver":"1511","client_app_ver":"vb.00.00.001","phone_num":"xxxxxxxxxxxxx","device_id":"xxxxxxxxxxxxx","phone_num_edited":"false","opr_info_edited":"false","sim_opr_mcc_mnc":"na","sim_country_iso":"in","api_ver":"2","app_secure_key":"xxxxxxxxxxx","client_os":"w","sim_serial_num":"xxxxxxxxxxxxxx"}';
  $response  = file_get_contents($request);
  $jsonobj  = json_decode($response);
  foreach($json as $item)
  {
      if($item-&gt;new_user == "false")
      {
          echo "ssdasdSA";
      }
  else {
  echo "Sdasds";
  }
  }
  } ?&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And here is the JSON output that I am trying to search new_user for:</p>
  
  <pre><code>{
      "cmd": "join_user",
      "status": "ok",
      "login_id": "918220524411",
      "user_secure_key": "b2ff39178db49257733ff76c093329c484589459ccc617167a2a98d40dc5359a3ff89b54ab04889c",
      "invite_sms_text": "Hi, I\u0027m using InstaVoice for Voicemail, Missed Calls, and Chatting. Connect with me on",
      "vsms_limits": "{\"limit\":50,\"perusr_limit\":50,\"debit\":1,\"credit\":1,\"users\":[]}",
      "docs_url": "http://devblogs.instavoice.com/vobolo/iv/docs/",
      "mqtt_hostname": "devmqtt.instavoice.com",
      "mqtt_port_ssl": 8883,
      "mqtt_password": "guest",
      "mqtt_user": "guest",
      "iv_support_contact_ids": "[{\"support_catg_id\":\"IVSupport\",\"support_catg\":\"Help\",\"show_as_iv_user\":true,\"iv_user_id\":\"2624836\",\"phone\":\"912222222222\",\"profile_pic_uri\":\"http:\\/\\/devblogs.instavoice.com\\/vobolo\\/profile-images\\/2222\\/2624836_help_a.png\",\"thumbnail_profile_pic_uri\":\"http:\\/\\/devblogs.instavoice.com\\/vobolo\\/thumbnails\\/2222\\/2624836_help_a.png\",\"support_send_iv\":true,\"support_send_sms\":false,\"support_send_email\":false},{\"feedback_catg_id\":\"IVFeedback\",\"feedback_catg\":\"Suggestions\",\"show_as_iv_user\":false,\"iv_user_id\":\"2624835\",\"phone\":\"911111111111\",\"profile_pic_uri\":\"http:\\/\\/devblogs.instavoice.com\\/vobolo\\/profile-images\\/1111\\/2624835_suggestions.png\",\"thumbnail_profile_pic_uri\":\"http:\\/\\/devblogs.instavoice.com\\/vobolo\\/thumbnails\\/1111\\/2624835_suggestions.png\",\"feedback_send_iv\":true,\"feedback_send_sms\":false,\"feedback_send_email\":false}]",
      "iv_user_id": 17198589,
      "iv_user_device_id": 61712,
      "screen_name": "68318465",
      "is_profile_pic_set": false,
      "profile_pic_uri": "http://devblogs.instavoice.com/vobolo/static-contents/images/default_profile_pic.jpg",
      "thumbnail_profile_pic_uri": "http://devblogs.instavoice.com/vobolo/static-contents/images/default_profile_pic_thumbnail.jpg",
      "facebook_connection": false,
      "twitter_connection": false,
      "fb_connected": false,
      "tw_connected": false,
      "fb_post_enabled": true,
      "tw_post_enabled": true,
      "fb_connect_url": "http://devblogs.instavoice.com/iv/fbc/",
      "tw_connect_url": "http://devblogs.instavoice.com/iv/twc/",
      "vsms_allowed": true,
      "country_isd": "91",
      "phone_len": 10,
      "last_fetched_msg_id": 0,
      "last_fetched_contact_trno": 0,
      "last_fetched_msg_activity_id": 0,
      "last_fetched_profile_trno": 0,
      "send_email_for_iv": true,
      "send_sms_for_iv": true,
      "send_email_for_vb": true,
      "send_sms_for_vb": true,
      "send_email_for_vsms": true,
      "send_sms_for_vsms": true,
      "action": "",
      "new_user": true,
      "phone_num_edited": false,
      "user_verified": true,
      "obd_timegap_sec": 45,
      "ring_expiry_min": 30,
      "chat_hostname": "devmqtt.instavoice.com",
      "chat_port_ssl": "8883",
      "chat_user": "guest",
      "chat_password": "guest"
  }
  </code></pre>