SQL like processing on array of keyed arrays ?

From: Date: Wed, 21 Apr 2004 14:36:44 +0000
Subject: SQL like processing on array of keyed arrays ?
Groups: php.general 
Request: Send a blank email to php-general+get-184135@lists.php.net to get a copy of this message
Suppose I don't have access to a database server. I have any indexed array of like keyed arrays, essentially mimicing a database table. Are there any libraries or functions that I can use to 'query' the array in a SQL like manner ? e.g. $data = array (array(a=>1,b=>2,c=>3) ,array(a=>2,b=>3,c=>4) ,array(a=>3,b=>4,c=>5) ); I would like to be able to do $subset = arraysql_query ($data, "where a>=3"); instead of $subset = array(); foreach ($data as $dat) { if ($dat['a'] >= 3) $subset[]=$dat; } -- Richard

« previous php.general (#184135) next »