Hello,
I'm looking to simply autonumber the rows of the data we're parsing from an XML feed. Currently, we're getting:
Result A 555
Result B 444
Result C 435
I'd like:
1 Result A 555
2 Result B 444
3 Result C 435
Any ideas?
Thank you.
Thank you, that's exactly what I was looking for!
Hi,
Create a counter variable outside of your myRecordHandler() function, and then within the function declare the counter variable as global, increment by 1 and include within your output as required; for example:
<?php
$counter = 0;
function myRecordHandler($record)
{
global $counter;
$counter++;
print $counter." ".$record["FIELD1"]." ".$record["FIELD2"]."\n";
}
?>
Hope this helps!
Cheers,
David
--
MagicParser.com