I have a php (v. 7.0.16) script running on the command line with this:
$ct = 1;
foreach($sort_this as $cur_site_id => $dx){
$cur_location = $locations[$cur_site_id]['location'];
$msg = "\033[A\33[2K\r" . 'getting data for %25s (' . $cur_site_id . ') store: %7s %01.2f' . "\n";
echo printf($msg, $cur_location, ($ct . ' / ' . count($sort_this)), number_format((($ct / count($sort_this)) * 100), 2));
$ct++;
}
This loop runs about 40 iterations. The printf statement works with 1 small problem. On the line after the "getting data" line I see a number that increments from 7x-7y as it runs (sometimes it starts at 71, sometimes at 77, etc.). I can't figure out what's causing this number to be printed. So when the loop starts I see something like this on the screen:
getting data for DENVER (531) store: 42 / 42 0.00
77
and when it finishes something like this:
getting data for SEATTLE (784) store: 42 / 42 100.00
79
I found how to print to the same line and clear the data here:
Erase the current printed console line
Is there a way to prevent the 7x codes from showing? Also, what are they?