01-09-2008, 02:26 PM
|
#4 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
You've already got the problem solved but I see no reason to waste time and energy when it's not necessary. Is there any reason why the following would not suffice?
PHP Code:
$hash = 'abc123,1'; if (preg_match('/\d{1,3}/', $hash, $matches)) { $bits = (int) $matches[0]; $hex = $bits / 4; unset ($matches); }
|
|
|
|