function kod($kod) { global $code; $kod = $code['SS'] . $code['BT'] . gen_binary($kod) . $code['SS']; $i = imagecreate(strlen($kod), 40); $w = imagecolorallocate($i, 255, 255, 255); $b = imagecolorallocate($i, 0, 0, 0); print_code($kod, $i, $b, $w); ob_start(); imagegif($i); $img = ob_get_contents(); ob_end_clean(); return $img; }
function kod($kod) { global $code; if (trim($kod, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $') != '') { error::add('Znaki inne niż cyfry, litery, pauza, kropka, spacja, ukośnik'); } $kod = $code['SS'] . $code['BT'] . gen_binary($kod) . $code['SS']; $i = imagecreate(strlen($kod), 40); $w = imagecolorallocate($i, 255, 255, 255); $b = imagecolorallocate($i, 0, 0, 0); print_code($kod, $i, $b, $w); ob_start(); imagegif($i); $img = ob_get_contents(); ob_end_clean(); return $img; }