Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <!--
- To change this license header, choose License Headers in Project Properties.
- To change this template file, choose Tools | Templates
- and open the template in the editor.
- -->
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Задание 6</title>
- <link rel="stylesheet" href="center.css" type="text/css">
- <link rel="shortcut icon" href="u.gif" type="image/gif">
- <style>
- </style>
- </head>
- <body>
- <figure class="center">
- <img src="zz.png">
- <br>
- ____________________________________________________________________<br>
- <?php
- var_dump($GLOBALS['ar']);
- if ($GLOBALS['ar'] != NULL) {
- echo "Текущее состояние массива:<br>[";
- for ($i = 0; $i < (count($GLOBALS['ar']) - 1); $i++) {
- echo " " . $GLOBALS['ar'][$i] . " |";
- }
- echo " " . $GLOBALS['ar'][count($GLOBALS['ar'])] . " ]";
- echo "<br>";
- echo "Введите дополнительные значения для массива:";
- } else {
- echo "Введите значения для массива через запятую:";
- $GLOBALS['ar'] = array();
- }
- ?>
- <form action="index.php" method="get">
- <input type="text" name="ar"><br>
- <input type="submit" value="Подтвердить">
- </form>
- <?php
- $c = filter_input(INPUT_GET, 'ar');
- echo "<br>$c<br>";
- $c = str_replace(", ", ",", $c);
- $c = str_replace(" ,", ",", $c);
- $GLOBALS['ar'] = array_merge($GLOBALS['ar'], explode(",", $c));
- print_r($GLOBALS['ar']);
- ?>
- </figure>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement