почему ошибку выдает?
It should take an array of numbers as its argument and return the two highest numbers within the array.
function twoOldestAges($ages) {
sort($ages);
return array_slice($ages, -2);
}
function twoOldestAges($ages) {
$a = -INF;
$b = -INF;
foreach ($ages as $n) {
if ($n > $a) {
$b = $a;
$a = $n;
} else if ($n > $b) {
$b = $n;
}
}
return [ $b, $a ];
}
<div class="header">
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
<div class="jumbotron">
<h1>hello</h1>
</div>
</div>
</div>
</div>
</div>
.header {
background: gray;
}
<div class="container-fluid">
<div class="row header">
<div class="col-md-12">
<div class="jumbotron">
<h1>hello</h1>
</div>
</div>
</div>
</div>
<?php
$servername = "localhost";
$username = "username";
$password = "password";
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Create database
$sql = "CREATE DATABASE myDB";
if ($conn->query($sql) === TRUE) {
echo "Database created successfully";
} else {
echo "Error creating database: " . $conn->error;
}
$conn->close();
?>