Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Json string is null

I have the following Json page:

<?php
 header('Content-Type: json; charset=utf-8');
 $lottery = array(
 array(
 "id" => 0,
 "navn" => "Vind telefon",
 "udgiver" => "Telia",
 "beskrivelse" => "Vind en Iphone 5 ved at gætte 1 spørgsmål",
 "tilmeldte" => 89,
 "startdate" => "10-04-2013",
 "enddate" => "30-06-2013"
 ),
 array(
 "id" => 1,
 "navn" => "Fri taletid",
 "udgiver" => "Telmore",
 "beskrivelse" => "Vind et års forbrug af fri data og fri taletid",
 "tilmeldte" => 701,
 "startdate" => "03-03-2013",
 "enddate" => "10-06-2013"
 ),
 array(
 "id" => 2,
 "navn" => "Vind 5000 kr.",
 "udgiver" => "Bilka",
 "beskrivelse" => "Vind et gavekort på 5000 kr til bilka.",
 "tilmeldte" => 101,
 "startdate" => "10-05-2013",
 "enddate" => "01-07-2013"
 ),
 array(
 "id" => 3,
 "navn" => "Fri vin",
 "udgiver" => "Føtex",
 "beskrivelse" => "Vind et års forbrug af vin",
 "tilmeldte" => 391,
 "startdate" => "01-04-2013",
 "enddate" => "10-07-2013"
 ),
 array(
 "id" => 4,
 "navn" => "Vind et TV",
 "udgiver" => "El-giganten",
 "beskrivelse" => "Vind et 60\" LED tv til stuen",
 "tilmeldte" => 22,
 "startdate" => "01-04-2013",
 "enddate" => "22-07-2013"
 ),
 array(
 "id" => 5,
 "navn" => "Vind en telefon",
 "udgiver" => "Samsung",
 "beskrivelse" => "Vind en Galaxy S4 4g telefon",
 "tilmeldte" => 784,
 "startdate" => "10-04-2013",
 "enddate" => "30-07-2013"
 ),
 array(
 "id" => 6,
 "navn" => "Gratis Vand",
 "udgiver" => "Aqua D'or",
 "beskrivelse" => "Vind et helt års forbrug af vand og dansk vand",
 "tilmeldte" => 345,
 "startdate" => "01-03-2013",
 "enddate" => "18-07-2013"
 ),
 array(
 "id" => 7,
 "navn" => "Fri Adwords",
 "udgiver" => "Google",
 "beskrivelse" => "Vind adwords kuponner til en værdi af 10.000",
 "tilmeldte" => 22,
 "startdate" => "10-02-2013",
 "enddate" => "22-08-2013"
 ),
 array(
 "id" => 8,
 "navn" => "Morgenmads produkter",
 "udgiver" => "Kellogs",
 "beskrivelse" => "Vind et helt års forbrug af kellogs produkter",
 "tilmeldte" => 111,
 "startdate" => "01-05-2013",
 "enddate" => "10-09-2013"
 ),
 array(
 "id" => 9,
 "navn" => "Vind tøjj for 10.000",
 "udgiver" => "Jack & Jones",
 "beskrivelse" => "Vind et gavekort til Jack & Jones på 10.000",
 "tilmeldte" => 33,
 "startdate" => "03-05-2013",
 "enddate" => "01-10-2013"
 )
 );
 //id, navn, udgiver, beskrivelse, tilmeldte, startdate, slutdate
 echo json_encode($lottery);

All of the fields works fine but one!

the field beskrivelse returns is null when i open my json.

Here is a link to My Json

And here is the json in plain text

[
  {
    "id": 0,
    "navn": "Vind telefon",
    "udgiver": "Telia",
    "beskrivelse": null,
    "tilmeldte": 89,
    "startdate": "10-04-2013",
    "enddate": "30-06-2013"
  },
  {
    "id": 1,
    "navn": "Fri taletid",
    "udgiver": "Telmore",
    "beskrivelse": null,
    "tilmeldte": 701,
    "startdate": "03-03-2013",
    "enddate": "10-06-2013"
  },
  {
    "id": 2,
    "navn": "Vind 5000 kr.",
    "udgiver": "Bilka",
    "beskrivelse": null,
    "tilmeldte": 101,
    "startdate": "10-05-2013",
    "enddate": "01-07-2013"
  },
  {
    "id": 3,
    "navn": "Fri vin",
    "udgiver": null,
    "beskrivelse": null,
    "tilmeldte": 391,
    "startdate": "01-04-2013",
    "enddate": "10-07-2013"
  },
  {
    "id": 4,
    "navn": "Vind et TV",
    "udgiver": "El-giganten",
    "beskrivelse": "Vind et 60\" LED tv til stuen",
    "tilmeldte": 22,
    "startdate": "01-04-2013",
    "enddate": "22-07-2013"
  },
  {
    "id": 5,
    "navn": "Vind en telefon",
    "udgiver": "Samsung",
    "beskrivelse": "Vind en Galaxy S4 4g telefon",
    "tilmeldte": 784,
    "startdate": "10-04-2013",
    "enddate": "30-07-2013"
  },
  {
    "id": 6,
    "navn": "Gratis Vand",
    "udgiver": "Aqua D'or",
    "beskrivelse": null,
    "tilmeldte": 345,
    "startdate": "01-03-2013",
    "enddate": "18-07-2013"
  },
  {
    "id": 7,
    "navn": "Fri Adwords",
    "udgiver": "Google",
    "beskrivelse": null,
    "tilmeldte": 22,
    "startdate": "10-02-2013",
    "enddate": "22-08-2013"
  },
  {
    "id": 8,
    "navn": "Morgenmads produkter",
    "udgiver": "Kellogs",
    "beskrivelse": null,
    "tilmeldte": 111,
    "startdate": "01-05-2013",
    "enddate": "10-09-2013"
  },
  {
    "id": 9,
    "navn": null,
    "udgiver": "Jack & Jones",
    "beskrivelse": null,
    "tilmeldte": 33,
    "startdate": "03-05-2013",
    "enddate": "01-10-2013"
  }
]

Can anyone tell me why this is happening?

Answer*

Draft saved
Draft discarded
Cancel

lang-php

AltStyle によって変換されたページ (->オリジナル) /