php8.5
Home/ Manual/ quickhash / quickhashstringinthash/ QuickHashStringIntHash::saveToFile

QuickHashStringIntHash::saveToFile

PHP function Edit on GitHub ✎

This method stores an in-memory hash to disk

Description

QuickHashStringIntHash::saveToFile(string $filename): void

This method stores an existing hash to a file on disk, in the same format that loadFromFile() can read.

Parameters

filename

The filename of the file to store the hash in.

Return Values

Void

Examples

QuickHashStringIntHash::saveToFile() example

php
<?php
$hash = new QuickHashStringIntHash( 1024 );
var_dump( $hash->add( "forty three", 42 ) );
var_dump( $hash->add( "fifty two", 52 ) );

$hash->saveToFile( '/tmp/test.hash.string' );
?>

Source: reference/quickhash/quickhashstringinthash/savetofile.xml · from the official PHP manual (php/doc-en)