shmop_size
(PHP 4 >= 4.0.4)
shmop_size -- Get size of shared memory block
Description
int shmop_size ( int shmid)
shmop_size() is used to get the size, in bytes of the shared
memory block.
shmop_size() takes the shmid, which is the shared memory
block identifier created by shmop_open(), the function will
return and int, which represents the number of bytes the
shared memory block occupies.
Example 1. Getting the size of the shared memory block
<?php
$shm_size = shmop_size($shm_id);
?>
This example will put the size of shared memory block identified
by $shm_id into $shm_size.
shmop_write
(PHP 4 >= 4.0.4)
shmop_write -- Write data into shared memory block
Description
int shmop_write ( int shmid, string data, int offset)
shmop_write() will write a string into shared memory block.
shmop_write() takes 3 parameters: shmid, which is the shared
memory block identifier created by shmop_open(), data, a
string that you want to write into shared memory block and
offset, which specifies where to start writing data inside
the shared memory segment.
Example 1. Writing to shared memory block
<?php
$shm_bytes_written = shmop_write($shm_id, $my_string, 0);
?>
This example will write data inside $my_string into shared
memory block, $shm_bytes_written will contain the number
of bytes written.