Associative Arrays in PHP

Multidimensional arrays can also be associative, for example, like this:

php<?php
  $arr = [
    'user1' => [
      'name' => 'name1',
      'age'  => 31,
    ],
    'user2' => [
      'name' => 'name2',
      'age'  => 32,
    ],
  ];
?>

Let's use this array to display, for example, the name of the second user:

php<?php
  echo $arr['user2']['name']; // will output 'name2'
?>
Задание 1

Given the following array:

php<?php
  $arr = [
    'boys'  => [1 => 'John', 2 => 'Jack', 3 => 'Ryan'],
    'girls' => [1 => 'Emma', 2 => 'Lily', 3 => 'Anna'],
  ];
?>

Using this array, output the name of the first boy and the name of the second girl.

Задание 2

Given the following array:

php<?php
  $arr = [
    [
      'name'   => 'user1',
      'age'    => 30,
      'salary' => 1000,
    ],
    [
      'name'   => 'user2',
      'age'    => 31,
      'salary' => 2000,
    ],
    [
      'name'   => 'user3',
      'age'    => 32,
      'salary' => 3000,
    ],
  ];
?>

Using this array, output the sum of the salaries of the first and third user.