$s->hide_printcoins = 1; $s->bottom_message = 'Interest Free Banking In Your Interest'; } if ($_REQUEST['client'] == 'ronpaul') { $s->icon = 'ronpaul.png'; $f = 2; $s->icon_w = $f * 600 / 840; $s->icon_h = $f * 840 / 840; $s->crypto = 'END THE FED'; $s->hide_vires = 1; } $pdf = new PDF('P', 'in', 'Letter'); $pdf->SetMargins($s->margin_top, $s->margin_left, $s->margin_right); $pdf->SetAutoPageBreak(false); if ($_REQUEST['squares']) { squares(); exit; } $p_c = $s->page_width / 2; $off_x = $p_c - $s->bill_w / 2; $off_y = 99999999; if (!$_REQUEST['bills']) { include 'form.html'; exit; } $bills = str_replace('"', '', $_REQUEST['bills']); $bills = str_replace('\\', '', $bills); $bills = explode("\n", $bills); $printer = $_REQUEST['printer']; if ($printer) { $printer = "Printed By: " . $printer;
<?php function squares($start, $stop) { if ($start < $stop) { for ($i = $start; $i <= $stop; $i++) { (yield $i => $i * $i); } } else { for ($i = $stop; $i >= $start; $i--) { (yield $i => $i * $i); } } } foreach (squares(3, 15) as $n => $square) { printf("%d squared is %d\n", $n, $square); }
<?php squares(10); function squares($num) { for ($i = 1; $i < $num + 1; $i++) { echo $i * $i . " "; } echo "\n"; }