Ejemplo n.º 1
0
function treffynnon_mandelbrot_to_mem($w, $h, $binary_output)
{
    $file_open_type = 'w+';
    if ($binary_output) {
        $file_open_type = 'w+b';
    }
    $stream = fopen('php://memory', $file_open_type);
    if (false === $stream) {
        return '';
    }
    write_mandelbrot_to_stream((int) $w, (int) $h, $stream, (bool) $binary_output);
    rewind($stream);
    $ret = stream_get_contents($stream);
    fclose($stream);
    return $ret;
}
Ejemplo n.º 2
0
function treffynnon_mandelbrot_to_mem($w, $h, $binary_output)
{
    ob_start();
    write_mandelbrot_to_stream((int) $w, (int) $h, (bool) $binary_output);
    return ob_get_clean();
}