usort($m, function($a, $b) {
$result = 0;
if ($a[5] > $b[5]) {
$result = 1;
} elseif ($a[5] < $b[5]) {
$result = -1;
}
return $result;
});
для чего в в классе два тире ?
if(isset($_GET['insert'])){
// Выполняем код при запросе script.php?insert
}
$sql = \DB::......;
$bindings = [];
foreach ($sql->getBindings() as $i => $binding) {
if ($binding instanceof \DateTime) {
$bindings[$i] = $binding->format('\'Y-m-d H:i:s\'');
} else {
if (is_string($binding)) {
$bindings[$i] = "'$binding'";
}
}
}
// Insert bindings into query
$query = str_replace(array('%', '?'), array('%%', '%s'), $sql->toSql());
$query = vsprintf($query, $bindings);
dd($query);
$sql = \DB::getQueryLog();;
foreach ($sql->bindings as $i => $binding) {
if ($binding instanceof \DateTime) {
$sql->bindings[$i] = $binding->format('\'Y-m-d H:i:s\'');
} else {
if (is_string($binding)) {
$sql->bindings[$i] = "'$binding'";
}
}
}
// Insert bindings into query
$query = str_replace(array('%', '?'), array('%%', '%s'), $sql->sql);
$query = vsprintf($query, $sql->bindings);
\DB::enableQueryLog();