This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: text/html; charset=utf-8'); | |
class Cars{ | |
protected $mark;// марка | |
public $type; // тип | |
public $tonnage; // тонаж | |
protected $places; // места | |
public function setMark($mark,$places){ | |
echo $mark . " " . $places . " мест"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Content-Type: text/html; charset=utf-8'); | |
class Cars{ | |
public $mark;// марка | |
public $type; // тип | |
public $tonnage; // тонаж | |
} | |
class Truck extends Cars { | |
public function __construct(){ | |
echo $this->mark = "MAN "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try | |
{ | |
$pdo = new PDO("mysql:host=localhost;dbname=joke_db", "root", ""); | |
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
$pdo->exec('SET NAMES "utf8"'); | |
} | |
catch (PDOException $e) | |
{ | |
$output = 'Невозможно подключиться к серверу баз данных :('. " <br>" .$e->getMessage(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Города</title> | |
</head> | |
<body> | |
<form method="POST" action="city.php"> | |
Город: <br> | |
<input type="text" name="city"/><br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Города</title> | |
</head> | |
<body> | |
<form method="POST" action="city.php"> | |
Город: <br> | |
<input type="text" name="city"/><br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Гостевая книга</title> | |
</head> | |
<body> | |
<form method="POST" action="guest.php"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Города</title> | |
</head> | |
<body> | |
<form method="POST" action="city.php"> | |
Город: <br> | |
<input type="text" name="city"/><br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Города</title> | |
</head> | |
<body> | |
<form method="POST" action="city.php"> | |
Город: <br> | |
<input type="text" name="city"/><br> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$a = array(); | |
$n = 10; | |
$counter = 1; | |
for($i=0;$i < $n ;$i++){ | |
for($j=0;$j <$n;$j++){ | |
$a[$j][$i] = $counter; | |
$counter++; | |
} | |
} | |
var_dump($a); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$numbers = 100; | |
$a = array(); | |
$z = array(); | |
$x = array(); | |
$array1 = array(); | |
$array3= array(); | |
$buffer = array(); | |
for($i = 0; $i <= $numbers;$i++){ | |
$a[] = $i; | |
} |