Exemplo n.º 1
0
function foo()
{
    $x = lol();
    $y = $x[0]['id'];
    var_dump($x);
    var_dump($x[1] = 'hi');
    return $y;
}
Exemplo n.º 2
0
function foo()
{
    $x = lol();
    $y = $x[0] = 2;
    var_dump($x);
    var_dump($y);
    $y = $x[][] = 2;
    var_dump($x);
    var_dump($y);
}
Exemplo n.º 3
0
 public function getPhotoDay()
 {
     $ta_photo = lol();
     return $tab_photo;
 }
Exemplo n.º 4
0
    $qip = gethostbyname('voci.dyndns.org');
    $q = source_query($qip . ':27020');
    if (!isset($q['players'])) {
        header("Content-type: image/png");
        $im = imagecreatefrompng('newsrcds2off.png');
    } else {
        $useimg = 'newsrcds2on.png';
        header("Content-type: image/png");
        $im = imagecreatefrompng($useimg);
        $white = imagecolorallocate($im, 255, 255, 255);
        imagestring($im, 2, 7, 1, $q['players'], $white);
    }
    imagepng($im);
    imagepng($im, $filename);
    imagedestroy($im);
}
// check to see if the local file exists
if (file_exists($filename)) {
    // get difference in seconds between now and last modified date
    $diff = time() - filemtime($filename);
    // if greater than 5mins (300 seconds) get new file from source
    if ($diff >= 60) {
        lol();
    } else {
        header("Content-type: image/png");
        readfile($filename);
    }
} else {
    // file doesn't exist, get data and create new file //
    lol();
}
Exemplo n.º 5
0
function foo()
{
    $x = lol();
    unset($x[0]['id']);
    return $x;
}