PHP Taskbook Level 8.3

Задание 1

Given some URL:

php$url = 'http://test.com/dir1/dir2/dir3/page.html';

Get the protocol from it:

php'http';
Задание 2

The following array is given:

php<?php
  $arr = [1, 2, 3, 4, 5, 6];
?>

The number is also given:

php<?php
  $num = 3;
?>

Add as many empty strings to the given array as necessary so that the length of the array becomes equal to the square of the number from the variable.

Задание 3

Display the following pyramid on the screen:

111
222
333
444
555
666
777
888
999