Главная /
Web-программирование на PHP 5.2 /
Каким будет результат выполнения следующего кода: <html> <head> <title>Example from intuit.ru</title> </head> <body> <?php $str = "123 234 345 456 567"; $result = preg_match('/\d(\d)\d/', $str, $found); echo "Matches
Каким будет результат выполнения следующего кода:
<html>
<head>
<title>Example from intuit.ru</title>
</head>
<body>
<?php
$str = "123 234 345 456 567";
$result = preg_match('/\d(\d)\d/', $str, $found);
echo "Matches: $result <br>";
print_r($found);
?>
</body>
</html>
вопрос
Правильный ответ:
в браузере получим:
Matches: 1, Array( [0] => 123 [1] => 2 )
в браузере получим:
Matches: 1, Array ( [0] => 123 234 [1] => 2 [2] => 3 )
в браузере получим:
Matches: 1, Array ( [0] => 123 234 345 [1] => 2 [2] => 3 [3] => 4 )
в браузере получим:
Matches: 1, Array ( [0] => 123 234 345 456 [1] => 2 [2] => 3 [3] => 4 [4] => 5 )
в браузере получим:
Matches: 1, Array ( [0] => 123 234 345 456 567 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 )
в браузере получим:
Matches: 1, Array( [0] => 234 [1] => 3 )
в браузере получим:
Matches: 1, Array( [0] => 345 [1] => 4 )
в браузере получим:
Matches: 1, Array( [0] => 456 [1] => 5 )
в браузере получим:
Matches: 1, Array( [0] => 567 [1] => 6 )
Сложность вопроса
64
Сложность курса: Web-программирование на PHP 5.2
92
Оценить вопрос
Комментарии:
Аноним
Я помощник профессора! Незамедлительно сотрите сайт с ответами с интуит. Это невозможно
15 апр 2020
Аноним
Это было сложно
12 окт 2018
Аноним
Это очень легкий тест по интуиту.
19 дек 2017
Другие ответы на вопросы из темы программирование интуит.
- # Каким будет результат выражения: <?php echo 4+2*9; ?>
- # Какие параметры у поля со списком в html?
- # Каким будет результат работы следующего кода: <html> <head> <title>Example from intuit.ru</title> </head> <body> <?php echo "Hi, I'm a PHP script!"; ?> </body> </html>
- # Каким будет результат применения фунуции strtolower к строке $string: <html> <head> <title>Example from intuit.ru</title> </head> <body> <?php $string="ВоЛнОоБрАзНыЙ ТеКсТ"; $string=strtolower($string); echo $string; ?> </body> </html>
- # Каким будет результат выполнения PHP-кода: <html> <head> <title>Example from intuit.ru</title> </head> <?php $input = array("red", "green", "blue", "yellow"); array_splice($input, 2); print_r($input); echo "<br>"; $input = array("red", "green", "blue", "yellow"); array_splice($input, 1, -1); print_r($input); echo "<br>"; $input = array("red", "green", "blue", "yellow"); array_splice($input, 1, count($input), "orange"); print_r($input); echo "<br>"; $input = array("red", "green", "blue", "yellow"); array_splice($input, -1, 1, array("black", "maroon")); print_r($input); echo "<br>"; $input = array("red", "green", "blue", "yellow"); array_splice($input, 3, 0, "purple"); print_r($input); echo "<br>"; ?> </body> </html>