String Search in PHP
Given a string:
<?php
$str = 'abc abc abc';
?>
Determine the position of the first letter 'b'
.
Given a string:
<?php
$str = 'abc abc abc';
?>
Determine the position of the last letter 'b'
.
Given a string:
<?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
.
Given a string:
<?php
$str = 'aaa aaa aaa aaa aaa';
?>
Determine the position of the second space.
Given a string:
<?php
$str = 'example..com';
?>
Check that the string has two dots in a row.
Given a string:
<?php
$str = 'http://example.com';
?>
Check that the string starts with 'http://'
.