Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/02/2021 in all areas

  1. @gizmola and I both gave you code that you have not implemented. You should spend some time going through this PDO tutorial. Making a PDO connection is one of the simplest things you would ever need to do. https://phpdelusions.net/pdo This is all that is required to make a PDO connection. Anything you do beyond this, you should know exactly WHY you are doing more. $con = new PDO("mysql:host=localhost;dbname=test", 'root', '');
    1 point
  2. Did you you mean something like this? $data = [ 'Hot' => [ 'A' => 5, 'B' => 20, 'C' => 15, 'D' => 10, 'E' => 8 ], 'Dead' => [ 'A' => 15, 'B' => 30, 'F' => 55, 'C' => 40, 'G' => 60, ] ]; echo '<pre> BEFORE ' . print_r($data, 1) . '</pre>'; // original array // // GET ALL KEYS // $keys = []; foreach ($data as $k1 => $v1) { $keys = array_merge($keys, array_keys($v1)); } $keys = array_unique($keys); $blank_values = array_fill_keys($keys, null); // // INSERT MISSING KEYS INTO THE SUBARRAYS // foreach ($data as $k => &$subarray) { $subarray = array_merge($blank_values, $subarray); } echo '<pre> AFTER ' . print_r($data, 1) . '</pre>'; // array after processing which gives... BEFORE Array ( [Hot] => Array ( [A] => 5 [B] => 20 [C] => 15 [D] => 10 [E] => 8 ) [Dead] => Array ( [A] => 15 [B] => 30 [F] => 55 [C] => 40 [G] => 60 ) ) AFTER Array ( [Hot] => Array ( [A] => 5 [B] => 20 [C] => 15 [D] => 10 [E] => 8 [F] => [G] => ) [Dead] => Array ( [A] => 15 [B] => 30 [C] => 40 [D] => [E] => [F] => 55 [G] => 60 ) )
    1 point
  3. For a Windows Dev my recommendation is Laragon and PhpStorm IDE. For Production Server, Debian OS with a current LAMP stack. You will also want to use GIT.
    1 point
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.