[php] 디비데이터를 JSON으로 출력하기
페이지 정보
본문
<?php
include_once('./_common.php');
$result = sql_query("select * from vn_content");
$rows = array();
while ($row = mysql_fetch_assoc($result))
{
$JSONres = array
(
"bg" => urlencode($row['bg']),
"bg_size" => urlencode($row['bg_size']),
"cter" => urlencode($row['cter']),
"cter_size" => urlencode($row['cter_size']),
"snd" => urlencode($row['snd']),
"snd_size" => urlencode($row['snd_size']),
"vib" => urlencode($row['vib']),
"txt" => urlencode($row['txt'])
);
array_push($rows, $JSONres);
}
echo (strip_tags(urldecode(json_encode($rows))));
?>
include_once('./_common.php');
$result = sql_query("select * from vn_content");
$rows = array();
while ($row = mysql_fetch_assoc($result))
{
$JSONres = array
(
"bg" => urlencode($row['bg']),
"bg_size" => urlencode($row['bg_size']),
"cter" => urlencode($row['cter']),
"cter_size" => urlencode($row['cter_size']),
"snd" => urlencode($row['snd']),
"snd_size" => urlencode($row['snd_size']),
"vib" => urlencode($row['vib']),
"txt" => urlencode($row['txt'])
);
array_push($rows, $JSONres);
}
echo (strip_tags(urldecode(json_encode($rows))));
?>
추천0
댓글목록
등록된 댓글이 없습니다.