String Search in PHP
strposstrrposstriposstrriposmb_strposmb_striposmb_strriposmb_strrposЗадание 1
Given a string:
php<?php
$str = 'abc abc abc';
?>
Determine the position of the first letter 'b'.
Задание 2
Given a string:
php<?php
$str = 'abc abc abc';
?>
Determine the position of the last letter 'b'.
Задание 3
Given a string:
php<?php
$str = 'abc abc abc';
?>
Determine the position of the first found letter 'b',
if you start the search not from the beginning of the string, but from
position 3.
Задание 4
Given a string:
php<?php
$str = 'aaa aaa aaa aaa aaa';
?>
Determine the position of the second space.
Задание 5
Given a string:
php<?php
$str = 'example..com';
?>
Check that the string has two dots in a row.
Задание 6
Given a string:
php<?php
$str = 'http://example.com';
?>
Check that the string starts with 'http://'.