안녕 얘들 아 내가 array_Push 기능을 이용하고 있고PHP JSON array_push가 NULL을 공백으로 대체 하시겠습니까?
array_push($result, array('order_id' => $row[0],
'type' => $row[2],
'description' => nl2br($row[3]),
'amount' => $row[4],
));
를 반환하는 array_push 기능을 위해 어떤 방법이 있는지 궁금하고로 json_encode과 내가이 테이블의 출력
"result":[{"order_id":"67","type":"HEADER","description":"Coca Cola","amount":null},{"order_id":"72","type":"TEXT","description":"French Fries","amount":null}
를 얻을 수 as
$.each(data.result, function(){
$("tbody").append("<tr id='order_"+this['order_id']+"'><td>"+this['type']+"</td><td></td><td>"+this['description']+" </td><td>"+this['amount']+"</td><br>");
그렇다면 공백으로 NULL 값이 반환 될 수있는 방법이 있는지 궁금합니다. 그렇다면 어디서 할 수 있습니까?
"공백"나는 그 문제에 관해서는 알고 있어요 PHP의 일, 또는 언어가 아닙니다 않습니다. – deceze
원본에서 문제를 해결할 수 있습니다. 문자열에 빈 문자열 대신 문자열에'NULL' 값이 필요하거나 필요합니까? – jeroen