PHP code example of gpslab / shmop
1. Go to this page and download the library: Download gpslab/shmop library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
gpslab / shmop example snippets
use GpsLab\Component\Shmop\Block;
$sh = new Block(
0xFF, // id for memory block
3 // memory block size
);
$sh->write('foo');
echo $sh->read(); // print 'foo'
$sh->delete();
use GpsLab\Component\Shmop\Block;
$sh = new Block(0xFF, 3);
// print contents of memory block. if block is not exists prints a blank line
echo $sh->read();