note 25117 deleted from function.intval by kennyt

From: Date: Wed, 04 Feb 2004 02:21:13 +0000
Subject: note 25117 deleted from function.intval by kennyt
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-64620@lists.php.net to get a copy of this message
Note Submitter: mholdgate@wakefield.co.uk ---- An alternative to intval, which will pick up the first integer within a string, wherever it is. function extract_int ($str) { ereg ('[^0-9]*([0-9]+)[^0-9]*', $str, $regs); return (intval ($regs[1])); }

« previous php.notes (#64620) next »