note 31761 modified in ref.shmop by danbrown
| From: | danbrown@php.net | Date: | Thu, 21 May 2009 15:07:43 +0000 |
| Subject: | note 31761 modified in ref.shmop by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155849@lists.php.net to get a copy of this message | ||
Just so you know, the ftok function is probably the best for getting the key.. just so there are not
people confused with how they are coming up with these hex codes for the id.
<?php
$fsize = filesize("/home/joeldg/testdata");
$fdata = file_get_contents("/home/joeldg/testdata");
$shm_id = shmop_open(ftok("/home/joeldg/testdata", 'R'), "c", 0644,
$fsize);
?>
--was--
Just so you know, the ftok function is probably the best for getting the key.. just so there are not
people confused with how they are coming up with these hex codes for the id.
$fsize = filesize("/home/joeldg/testdata");
$fdata = file_get_contents("/home/joeldg/testdata");
$shm_id = shmop_open(ftok("/home/joeldg/testdata", 'R'), "c", 0644,
$fsize);
http://php.net/manual/en/ref.shmop.php