public static function fwrite($fh, $string)
    {
        for ($written = 0; $written < strlen($string); $written += $fwrite) {
            if (($fwrite = fwrite($fh, substr($string, $written))) === false) {
                return $written;
            }
        }

        return $written;
    }
public static function fwrite($fh, $string)
    {
        for ($written = 0; $written < strlen($string); $written += $fwrite) {
            if (($fwrite = fwrite($fh, substr($string, $written))) === false) {
                return $written;
            }
        }

        return $written;
    }
public static function fwrite ( $ fh , $ string ) { for ( $ written = 0 ; $ written < strlen ( $ string ) ; $ written += $ fwrite ) { if ( ( $ fwrite = fwrite ( $ fh , substr ( $ string , $ written ) ) ) === false ) { return $ written ; } } return $ written ; }
Write a string to a resource

@param resource $fh     The resource to write to
@param string   $string The string to write
Write a string to a resource