note 26614 deleted from function.shm-attach by maxim
| From: | maxim@php.net | Date: | Wed, 06 Nov 2002 18:55:50 +0000 |
| Subject: | note 26614 deleted from function.shm-attach by maxim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-39064@lists.php.net to get a copy of this message | ||
as for previous example ...
function memsegspot should look like
function memsegspot($str)
{
$str = str_pad($str, 4, "Z"); // Z = 5a
for ($a=0; $a<4; $a++)
{
$out1 = substr($str, $a , 1); // walk through
$out .= dechex(ord($out1)); // ord returns dec, we need hex for shared memory
segments
}//
return intval($out, 16); // convert to int using base 16
}
overwise shm_attach() and sem_get() will treat key as 0