note 25117 added to function.intval

From: Date: Wed, 11 Sep 2002 10:14:36 +0000
Subject: note 25117 added to function.intval
Groups: php.notes 
Request: Send a blank email to php-notes+get-36504@lists.php.net to get a copy of this message
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])); } -- http://www.php.net/manual/en/function.intval.php http://master.php.net/manage/user-notes.php?action=edit+25117 http://master.php.net/manage/user-notes.php?action=delete+25117 http://master.php.net/manage/user-notes.php?action=reject+25117

« previous php.notes (#36504) next »