AV1611 Posted June 27, 2006 Share Posted June 27, 2006 if I have an array like this:Array( [datshtid] => 000371 [sample] => 000005 [it_date] => 2006-01-12 [insptype] => Final Inspections [process] => VQ Functional Outputs [product] => TEK.SS3.UNIT [descr] => Fit in cradle [serialno] => S3001015 [failed] => 0 [hi] => 0 [lo] => 0 [units] => [actual] => 0 [gonogo] => 1 [passfail] => 0 [step] => 1 [passed] => 1)and I want it keyed by numbers ([0] => 000371, etc.) instead,how can I convert it with PHP.... I am not using MySQL, but ODBC, so I am stuck with what I got I guessThanks Quote Link to comment https://forums.phpfreaks.com/topic/13030-changing-array-keying/ Share on other sites More sharing options...
Orio Posted June 27, 2006 Share Posted June 27, 2006 [code]function number_array($arr){$i=0;foreach ($arr as $value){$arr2[$i]=$value;$i++;};return $arr2;};[/code]Orio. Quote Link to comment https://forums.phpfreaks.com/topic/13030-changing-array-keying/#findComment-50155 Share on other sites More sharing options...
wildteen88 Posted June 27, 2006 Share Posted June 27, 2006 Is this a result from an ODBC query? If it is you can use odbc_fetch_rows function, which is the same as mysql_fetch_rows, but works with odbc instead. Quote Link to comment https://forums.phpfreaks.com/topic/13030-changing-array-keying/#findComment-50171 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.