note 26614 added to function.shm-attach
| From: | proforg at maloletka dot ru | Date: | Wed, 06 Nov 2002 18:31:57 +0000 |
| Subject: | note 26614 added to function.shm-attach | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39060@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
--
http://www.php.net/manual/en/function.shm-attach.php
http://master.php.net/manage/user-notes.php?action=edit+26614
http://master.php.net/manage/user-notes.php?action=delete+26614
http://master.php.net/manage/user-notes.php?action=reject+26614