Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/298.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP数组到json的过滤_Php_Json_Codeigniter - Fatal编程技术网

PHP数组到json的过滤

PHP数组到json的过滤,php,json,codeigniter,Php,Json,Codeigniter,我使用的是Codeigniter,我需要选择的映射(过滤器)值。 例如,我有一些查询,比如SELECT*FROM users,我只想要mapfirst\u name和last\u name而不是所有N列。 它是否存在一些LIB或映射/筛选工具,我可以在其中指定映射模板?您可以从数据库中选择所需字段,如从用户中选择名字、姓氏@Scorpion坏主意,因为我每次都需要关心select语句。我希望选择总是相同的,执行一些操作,然后映射json/P@Irfan我认为这里不需要代码。我发现要解决我的问题,

我使用的是
Codeigniter
,我需要选择的映射(过滤器)值。 例如,我有一些查询,比如
SELECT*FROM users
,我只想要map
first\u name
last\u name
而不是所有N列。
它是否存在一些LIB或映射/筛选工具,我可以在其中指定映射模板?

您可以从数据库中选择所需字段,如
从用户中选择名字、姓氏
@Scorpion坏主意,因为我每次都需要关心select语句。我希望选择总是相同的,执行一些操作,然后映射json/P@Irfan我认为这里不需要代码。我发现要解决我的问题,我需要类似于
Datamapper ORM
的东西,但它看起来太旧了,我无法下载这个库:(