HTML interesse |
|
Warning: fopen(errors.php): failed to open stream: Permission denied in /home/sintpiet/public_html/lid/functions.php on line 30
Warning: func_get_arg(): Argument 2 not passed to function in /home/sintpiet/public_html/lid/functions.php on line 32
Warning: fputs(): supplied argument is not a valid stream resource in /home/sintpiet/public_html/lid/functions.php on line 38
Warning: fclose(): supplied argument is not a valid stream resource in /home/sintpiet/public_html/lid/functions.php on line 40
<?php
if(!function_exists('file_put_contents'))
{
function file_put_contents( $sFileName, $sContents )
{
if(!file_exists( $sFileName ))
{ // File does not exists
trigger_error( 'file_put_contents(): file does not exists', E_USER_WARNING); // Return an error
return FALSE; // And a FALSE boolean
}
else
{
$rOpenFile = fopen( $sFileName, 'r+' ); // Open the file
if(func_get_arg(2) != '')
{
fputs( $rOpenFile, substr($sContents , 1, (int) func_get_arg(2))); // Put the contents
}
else
{
fputs( $rOpenFile, $sContents );
}
fclose( $rOpenFile ); // Close the file
return TRUE; // Return a TRUE boolean
}
}
} ?>
<?php { function file_put_contents( $sFileName, $sContents ) { { // File does not exists trigger_error( 'file_put_contents(): file does not exists', E_USER_WARNING); // Return an error return FALSE; // And a FALSE boolean } else { $rOpenFile = fopen( $sFileName, 'r+' ); // Open the file { } else { fputs( $rOpenFile, $sContents ); } fclose( $rOpenFile ); // Close the file return TRUE; // Return a TRUE boolean } } } ?>
|