0

是否有任何类型的 php 库可以对数组执行 SQL 查询?

像这样的东西:

$array = array(
    array(
        "field_a" => "first_a"      
        "field_b" => "something"        
    ),
    array(
        "field_a" => "second_a"     
        "field_b" => "else"     
    ),
    array(
        "field_a" => "third_a"      
        "field_b" => "something"        
    )
);

$rows = arrayQuery($array, "SELECT field_a WHERE field_b = 'something'");

/*
$rows = array(
    array(
        "field_a" => "first_a"      
    ),
    array(
        "field_a" => "third_a"      
    )
);
 */

发现类似的东西:http ://blog.phpdeveloper.org/?p=61 ,但这不是查询。

4

1 回答 1

2

我相信PHP 的 LINQ 可以解决问题。我认为这已经接近 PHP 中的“查询数组”。

于 2012-08-09T12:29:29.543 回答