in_array returning index & free_memory

From: Date: Sat, 05 Aug 2000 17:15:43 +0000
Subject: in_array returning index & free_memory
Groups: php.db 
Request: Send a blank email to php-db+get-1802@lists.php.net to get a copy of this message
Hi, I use OCIFetchStatement to get a big array will all the rows from my sql query. Then I create unidimensional arrays for each field in my select: OCIFetchStatement ($s, $rows); $field1 = $rows["FIELD1"]; $field2 = $rows["FIELD2"]; I want to know if a value is in $field1 and, if so, its index. PHP function in_array just returns true or false. Is there any other function that returns the index where the value is found ? I don't know how in_array works, but if it is just a loop through all the array, it is a shame that it does not return the index, isn't it ? Another question, those unidimensional arrays are used for a complex graph algorithm and I want to release memory. I use OCIFreeStatement, but I also want to free $rows. Is there a kind of free_memory($rows) ? Would "$rows = 0;" just do the trick ?

« previous php.db (#1802) next »