String Checking in PHP
str_starts_withstr_ends_withstr_containsЗадание 1
Given a string:
php<?php
$str = 'document.pdf';
?>
Check if the string ends with '.pdf'.
Задание 2
Given a string:
php<?php
$str = 'https://example.com';
?>
Check if the string starts with 'https://'.
Задание 3
Given a string:
php<?php
$str = 'The quick brown fox';
?>
Check if the string contains the substring 'fox'.
Задание 4
Given a string:
php<?php
$str = 'image.png';
?>
Check if the string ends with '.png' or '.jpg'.
Задание 5
Given a string:
php<?php
$str = 'admin@example.com';
?>
Check if the string contains the character '@' and ends with '.com'.