[FX.php List] Can you pull from array?

DC dan.cynosure at dbmscan.com
Tue Oct 17 19:20:12 MDT 2006


in response to myself.... sorry list.

if you **really** want to use for() or while() and iterate the FX.php  
data array yourself with an incrementor you can get to a numerically  
indexed FX.php data item by using array_values() on the FX.php result  
data item.

here's some code to show you what the data item looks like after  
array_values():

<?php
// mock up array like FX.php data
$searchResult['data'] = array(
'1.1' => array('fieldname' => array('data1')),
'2.2' => array('fieldname' => array('data2')),
'3.3' => array('fieldname' => array('data3')) );

echo '<pre>';
print_r(($searchResult['data']));
print_r(array_values($searchResult['data']));
echo '</pre>';
?>

cheers,
dan

On Oct 17, 2006, at 9:10 PM, DC wrote:

> using for() or while() to iterate the data array is annoying since  
> you don't have a numerical index to rely on; the indexing is based  
> on recid and modification count!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.iviking.org/pipermail/fx.php_list/attachments/20061017/e6aedad8/attachment-0001.html


More information about the FX.php_List mailing list