Could someone please add comments to this code? Or, alternatively, what would be the pseudocode equivalent of this Ruby code?
It seems simple enough but I just don't know enough Ruby to convert this to PHP.
data = Hash.new({})
mysql_results.each { |r| data[r['year']][r['week']] = r['count'] }
(year_low..year_high).each do |year|
(1..52).each do |week|
puts "#{year} #{week} #{data[year][week]}"
end
end
Any help whatsoever would be really appreciated.
Thanks!