Script Caching with PHP




if ( !$write ) {

// you might not have permission
// to write in that directory.

echo ( "could not open $writefile for writing" );
exit;
}

// lock the write file and
// write all the HTML into it

if ( !flock ( $write , LOCK_EX + LOCK_NB )) {

// for PHP version < 4.0.1
// change LOCK_EX to 2

echo ( "could not lock $writefile" );
exit;
}

fwrite ( $write , $HTML_output , strlen ( $HTML_output ) );
flock ( $write , LOCK_UN );

// release lock. For PHP version < 4.0.1
// change LOCK_UN to 3

fclose ( $write );
?>


Copyright © 2008 chengduxinxi.com All Rights Reserved PHP编程开发 由朝夕网络维护