Stringide kontrollimine PHP-s

str_starts_withstr_ends_withstr_contains
Задание 1

Antud on string:

php<?php
  $str = 'document.pdf';
?>

Kontrollige, kas string lõpeb '.pdf'-ga.

Задание 2

Antud on string:

php<?php
  $str = 'https://example.com';
?>

Kontrollige, kas string algab 'https://'-ga.

Задание 3

Antud on string:

php<?php
  $str = 'The quick brown fox';
?>

Kontrollige, kas string sisaldab alamstringi 'fox'.

Задание 4

Antud on string:

php<?php
  $str = 'image.png';
?>

Kontrollige, kas string lõpeb '.png' või '.jpg'-ga.

Задание 5

Antud on string:

php<?php
  $str = 'admin@example.com';
?>

Kontrollige, kas string sisaldab sümbolit '@' ja lõpeb '.com'-ga.