note 71716 deleted from function.intval by nlopess

From: Date: Mon, 18 Dec 2006 11:16:23 +0000
Subject: note 71716 deleted from function.intval by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-120731@lists.php.net to get a copy of this message
Note Submitter: monkey DOT 05 DOT 06 AT gmail DOT com ---- <?php function charval($var) { $i = intval($var); for (; $i < 0; $i += 256); for (; $i > 255; $i -= 256); return $i; } ?> Forces $var into a range between 0 and 255 (inclusive).

« previous php.notes (#120731) next »