"선택"부분이 null을 반환하지만 PHP 배열을 json_encode하려고합니다.배열에 null을 반환하는 json_encode
Array ([indexer] => 7 [section] => 1 [question] => What does the last paragraph indicate about an optimistic perspective? [answer] => a [choices] => There has never been a culture or religion that is genuinely optimistic`It is “a riddle of the universe”`No enlightened culture sees the world in a truly optimistic manner`Optimistic perspectives are only held by the weak)
{"indexer":"7","section":"1","question":"What does the last paragraph indicate about an optimistic perspective?","answer":"a","choices":null}
이유가 무엇입니까?
편집 : 전체 코드는 :
$check = mysqli_query($con, "select * from questions where section = '$section' and indexer = '$question'");
$result = mysqli_fetch_array($check, MYSQLI_ASSOC);
print_r($result);
echo json_encode($result);
는 소리하지 않습니다 값 –
그 점을 이해합니다. 왜 그런지 알아 내려고하는 중이 야. – user2570937
분명히 해줄 수 있겠 니? : print_r 등의 첫 줄 ('Array ...')이 무엇입니까? 해당 배열을 정의하는 방법을 보여줍니다. 당신은 그 따옴표 전부를 도주하는 것을 확인하고 있는가? – philtune