$servers[ $i ][ open_date ] > $date
$servers[ $i ][ 'open_date' ] > $date
<?php
for($i = 0; $i < $count; $i++){
$servers[ $i ];//Что это?
if( ( $servers[ $i ][ 'open_date' ] > $date ) && ( $servers[ $i ][ 'allow' ] == 1 ) ){
$servers_notopened[] = $servers[ $i ];
}elseif( isset( $_POST['chronicles'] ) && isset( $_POST['raites'] ) ){
for($i = 0; $i < $count; $i++){//У нас for $i, надо использовать $j
$servers[ $i ];
if( ( ( $servers[ $i ][ 'open_date' ] > $date ) && ( $servers[ $i ][ 'allow' ] == 1 ) )//Мы тут \DateTime сравниваем?!
&& ( ( $servers[ $i ][ 'chronicles' ] == $_POST['chronicles'] )
&& ( $servers[ $i ][ 'raite' ] == $_POST['raites'] ) )
){
$servers_notopened[] = $servers[ $i ];
}
}
}
if( ( $servers[ $i ][ 'open_date' ] == $date ) && ( $servers[ $i ][ 'allow' ] == 1 ) ){
$servers_today[] = $servers[ $i ];
}elseif( isset( $_POST['chronicles'] ) && isset( $_POST['raites'] ) ){
for($i = 0; $i < $count; $i++){//Есть for по $i,$j используем $p
$servers[ $i ];
if( ( ( $servers[ $i ][ 'open_date' ] == $date ) && ( $servers[ $i ][ 'allow' ] == 1 ) )
&& ( ( $servers[ $i ][ 'chronicles' ] == $_POST['chronicles'] )
&& ( $servers[ $i ][ 'raite' ] == $_POST['raites'] ) )
){
$servers_today[] = $servers[ $i ];
}
}
}
if( ( $servers[ $i ][ 'open_date' ] < $date ) && ( $servers[ $i ][ 'allow' ] == 1 ) ){
$servers_opened[] = $servers[ $i ];
}elseif( isset( $_POST['chronicles'] ) && isset( $_POST['raites'] ) ){
for($i = 0; $i < $count; $i++){//Есть for по $i,$j,$p используем $q
$servers[ $i ];
if( ( ( $servers[ $i ][ 'open_date' ] < $date ) && ( $servers[ $i ][ 'allow' ] == 1 ) )
&& ( ( $servers[ $i ][ 'chronicles' ] == $_POST['chronicles'] )
&& ( $servers[ $i ][ 'raite' ] == $_POST['raites'] ) )
){
$servers_opened[] = $servers[ $i ];
}
}
}
}
<?php
function returnNumberFromLastWord($str) {
$lastWord = array_pop( explode( ' ', $str ) );
if( false !== strpos( $lastWord, '>' ) ){
$lastWord = substr( $lastWord, strpos( $lastWord, '>' ) + 1 );
}
$number = filter_var( $lastWord, FILTER_SANITIZE_NUMBER_INT );
return substr( $number, strlen( $number ) - 14 );
}
//////////////////////////////////////////////////////////////////////////////////////
$a = '159111/08/199915 -BPOSS CS PG1 1>400010516305897TEXTYU';
$b = 'IVAN PUPKOV 1179010/27/2011HOLD-BMAN/DEL CS PG0100010515465174LIALIA';
echo $a, '<br>';
echo returnNumberFromLastWord($a);
echo '<br>';
echo $b, '<br>';
echo returnNumberFromLastWord($b);
$z=0;
foreach($data as $k=>$v){
$z++;
if($z===50){
$z = 0;
usleep( 200000 );// 0,2 sec
}
}
<?php
$firstquarter = array(1 => 'January', 'February', 'March');
print_r($firstquarter);
?>
$array = [1,2,3];
array_unshift($array, '' );
unset($array[0]);
class SmtpEmailMessageSender implements Sender
{
private $server;
private $login;
private $password;
public function __construct($server, $login, $password)
{
$this->server = $server;
$this->login = $login;
$this->password = $password;
}
function send(Message $message)
{
if( !($message instanceof EmailMessage) ){throw new InvalidArgumentException("Instance of 'EmailMessage' expected. Got '".get_class($message)."'");}
//...
}
}
$rea = array_slice($new_arr, $x, $_REQUEST['count']);
$new_arr = range(1, 200);
$page = (int)$_GET['page'] - 1;//logically we have page 0, but UI will show page 1
$count = (int)$_GET['count'];
$count = ($count > 0 && $count<=50)$count?50;
$startElementIndex = $page * $count;
$rea = array_slice($new_arr, $startElementIndex, $count);
var_dump($rea);
$result = mysqli_query($con, $query);
function selected($db_name){
global $con;
...
}