PHP code example of klaussilveira / simple-shm

1. Go to this page and download the library: Download klaussilveira/simple-shm 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/ */

    

klaussilveira / simple-shm example snippets




use Simple\SHM\Block;

/**
 * Creating new block, with a random ID
 */
$memory = new Block;
$memory->write('Sample');
echo $memory->read();

/**
 * Creating new block, with an specified ID
 */
$new = new Block(897);
$new->write('Sample');
echo $new->read();

/**
 * Reading an existing block, with the ID of 42
 */
$existing = new Block(42);
echo $existing->read();