SHARE
TWEET

Untitled

a guest Jun 19th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.     $stats = array();
  4.     for($i = 1; $i <= 12; $i++) {
  5.         $stats[$i] = retrieveStats('orange/actualite', '2010', '10'));
  6.         if ($stats[$i] === false) {
  7.             $stats[$i] = array(
  8.                 'un' => 123,
  9.                 'deux' => 234,
  10.                 'trois' => 345,
  11.             );
  12.             storeStats('orange/actualite', '2010', '10', $stats[$i]);
  13.         }
  14.     }
  15.    
  16.     function storeStats($section_name, $year, $month, $stats) {
  17.         foreach ($stats as $stats_name => $stats_value) {
  18.             $this->db->insert('stats_orange', array(
  19.                 'section_name' => $section_name,
  20.                 'month'        => $month,
  21.                 'year'         => $year,
  22.                 'stats_name'   => $stats_name,
  23.                 'stats_value'  => $stats_value,
  24.             );
  25.         }
  26.     }
  27. ?>
RAW Paste Data
Want to get better at PHP?
Learn to code PHP in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top