<?php
header('Content-Type: application/json;charset=utf-8');
$db = new SQLite3('../api/.db.db');
$res = $db->query("SELECT * FROM store");
while ($row = $res->fetchArray()) {
    $added_date = $row['added_date'];
    $description = $row['description'];
    $icon = $row['icon'];
    $name = $row['name'];
    $url = $row['url'];
    $video = $row['video'];
    $version = $row['version'];
    $version_code = $row['version_code'];
@$base64 = base64_decode($row['description']);
    if(!empty($url))
    {
    $output.='{"title":"'.$name.'","description":"'.$base64.'","link":"'.$url.'","thumbnail":"'.$icon.'","tag":"Android Application","date":"'.$added_date.'"}';
    }
}
$output1=str_replace('}{','},{',$output);
$json_string='{"items":['.$output1.']}';
echo $json_string;
?>