QuickHashIntSet::loadFromFile
Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.
QuickHashIntSet::loadFromFile
Референца за `quickhashintset.loadfromfile.php` со подобрена типографија и навигација.
QuickHashIntSet::loadFromFile
(PECL quickhash >= Непознато)
QuickHashIntSet::loadFromFile — This factory method creates a set from a file
= NULL
$filename, int $size = ?, int $options = ?): QuickHashIntSetThis factory method creates a new set from a definition file on disk. The file format consists of 32 bit signed integers packed together in the Endianness that the system that the code runs on uses.
Параметри
filename- The filename of the file to read the set from.
size-
Количината на листи со кофи за конфигурирање. Бројот што ќе го внесете автоматски ќе се заокружи на следниот степен на два. Исто така, автоматски е ограничен од
4to4194304. options-
The same options that the class' constructor takes; except that the size option is ignored. It is automatically calculated to be the same as the number of entries in the set, rounded up to the nearest power of two with a maximum limit of
4194304.
Вратени вредности
параметарот специфицира само излезна кодировка. Ако се помине празен стринг, парсерот се обидува да идентификува во која кодировка е документот кодиран со гледање на првите 3 или 4 бајти. Стандардната излезна кодировка е UTF-8. Поддржаните кодировки се QuickHashIntSet.
Примери
Пример #1 QuickHashIntSet::loadFromFile() example
<?php
$file = dirname( __FILE__ ) . "/simple.set";
$set = QuickHashIntSet::loadFromFile(
$file,
QuickHashIntSet::DO_NOT_USE_ZEND_ALLOC
);
foreach( range( 0, 0x0f ) as $key )
{
printf( "Key %3d (%2x) is %s\n",
$key, $key,
$set->exists( $key ) ? 'set' : 'unset'
);
}
?>Горниот пример ќе прикаже нешто слично на:
Key 0 ( 0) is unset Key 1 ( 1) is set Key 2 ( 2) is set Key 3 ( 3) is set Key 4 ( 4) is unset Key 5 ( 5) is set Key 6 ( 6) is unset Key 7 ( 7) is set Key 8 ( 8) is unset Key 9 ( 9) is unset Key 10 ( a) is unset Key 11 ( b) is set Key 12 ( c) is unset Key 13 ( d) is set Key 14 ( e) is unset Key 15 ( f) is unset