1
我试图在PHP Slim framework
中执行一个获取请求。但是我的MYSQL
数据库中有一个BLOB
变量。其中包含strings
的array
。如何检索BLOB
变量并将其转换回strings
的array
。带有BLOB变量的Slim GET请求
这里是我取的方法
// fetch all apps
$app->get('/apps', function ($request, $response, $args) {
$sth = $this->db->prepare("SELECT * FROM app ORDER BY updated_at");
$sth->execute();
$apps = $sth->fetchAll();
return $this->response->withJson($apps);
});
这里$apps
有一个名为locale
变量,它是BLOB
。我想退回$apps
与array
的strings
如何被存储到BLOB字符串数组?什么是当前代码的JSON输出? –