PHP Beyond the web by Aley Rob

PHP Beyond the web by Aley Rob

Author:Aley, Rob
Language: eng
Format: epub, mobi
Publisher: Rob Aley
Published: 2015-07-04T16:00:00+00:00


1 <? 2 3 $segment = shmop_open('1234456', 'c', 0755, 1024); 4 5 for ($counter=0; $counter < 20; $counter++) { 6 7 $jsonArray = json_encode( 8 array(rand(0,50000), 9 rand(0,2000), 10 rand(5000,100000)) 11 ); 12 13 $jsonArray = str_pad($jsonArray, 1024-strlen($jsonArray), ' '); 14 15 $dataSize = strlen($jsonArray); 16 17 $bytesWritten = shmop_write($segment, $jsonArray, 0); 18 19 if (!$bytesWritten) { echo("Error - couldn't write to memory\n"); }; 20 21 if ($dataSize != $bytesWritten) { 22 echo("Error - couldn't write all data to memory\n"); 23 }; 24 25 sleep(1); 26 27 }; 28 29 shmop_delete($segment); 30 31 shmop_close($segment);



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.