On thing you might want to do is replace an old string with a shorter one, or to clear out the string altogether.
To replace the string, you can zero-byte pad the string you are writing:
<?php
// $shmid is from shmop_open()
$size = 128;
$string = 'something';
// write
$string = str_pad(string, $size, "\0");
shmop_write($shmid, $string, 0);
// read
print rtrim(shmop($shmid,0,0),,"\0");
// clear
$string = str_repeat("\0",$size);
shmop_write($shmid, $string, 0);
?>