PHP SplFixedArray getSize() Function Last Updated : 23 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The SplFixedArray::getSize() function is an inbuilt function in PHP which is used to get the size of the array. Syntax: int SplFixedArray::getSize() Parameters: This function does not accept any parameter. Return Value: This function returns the size of the array. Below programs illustrate the SplFixedArray::getSize() function in PHP: Program 1: php <?php // Create a fixed array $gfg = new SplFixedArray(15); // Print Size of the array echo $gfg->getSize(); ?> Output: 15 Program 2: php <?php // Create some fixed size array $gfg1 = new SplFixedArray(0); $gfg2 = new SplFixedArray(9); $gfg3 = new SplFixedArray(100); $gfg4 = new SplFixedArray(878); // Print Size of the array echo $gfg1->getSize() . "\n"; echo $gfg2->getSize() . "\n"; echo $gfg3->getSize() . "\n"; echo $gfg4->getSize() . "\n"; // Set array size $gfg1->setSize(100); $gfg2->setSize(200); // Print size after set echo $gfg1->getSize() . "\n"; echo $gfg2->getSize() . "\n"; ?> Output: 0 9 100 878 100 200 Reference:https://www.php.net/manual/en/splfixedarray.getsize.php Comment More infoAdvertise with us Next Article PHP SplFixedArray getSize() Function R R_Raj Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP SplFixedArray key() Function The SplFixedArray::key() function is an inbuilt function in PHP which is used to get the key of the current index of the array. Syntax: int SplFixedArray::key() Parameters: This function does not accept any parameter. Return Value: This function returns the key of the current index of the array. Bel 1 min read PHP SplFixedArray offsetGet() Function The SplFixedArray::offsetGet() function is an inbuilt function in PHP that is used to get the offset of the specified index in an array. Syntax: mixed SplFixedArray::offsetGet( $index ) Parameters: This function accepts a single parameter $index which specifies the requested offset. Return Value: Th 1 min read PHP SplFixedArray offsetUnset () Function The SplFixedArray::offsetUnset() function is an inbuilt function in PHP which is used to unset the value of the requested index. Syntax: void SplFixedArray::offsetUnset( $index ) Parameters: This function accepts a single parameter $index which specifies the required index whose values need to unset 1 min read PHP SplFixedArray setSize() Function The SplFixedArray::setSize() function is an inbuilt function in PHP which is used to set the size of the array. Syntax: bool SplFixedArray::setSize( $size ) Parameters: This function accepts a single parameter $size which specifies the size of the array. Return Value: This function returns true on s 1 min read PHP | SplFileInfo getSize( ) Function The SplFileInfo::getSize() function is an inbuilt function of Standard PHP Library (SPL) in PHP which is used to get file size in bytes. Syntax: int SplFileInfo::getSize( void ) Parameters: This function does not accept any parameter. Return values: This function returns the size of file in bytes. B 1 min read PHP SplFixedArray offsetExists() Function The SplFixedArray::offsetExists() function is an inbuilt function in PHP which is used to check provided index exist or not in an array. Syntax: bool SplFixedArray::offsetExists( $index ) Parameters: This function accepts single parameter $index which specifies the requested index. Return Value: Thi 1 min read PHP SplFixedArray count() Function The SplFixedArray::count() function is an inbuilt function in PHP which is used to return the size of the array. Syntax: int SplFixedArray::count() Parameters: This function does not accept any parameter. Return Value: This function returns the size of the array. Below programs illustrate the SplFix 1 min read PHP SplFixedArray valid() Function The SplFixedArray::valid() function is an inbuilt function in PHP which is used to check the array can contain more elements or not. Syntax: bool SplFixedArray::valid() Parameters: This function does not accept any parameter. Return Value: This function returns true on success, false otherwise. Belo 1 min read PHP SplFixedArray toArray() Function The SplFixedArray::toArray() function is an inbuilt function in PHP which is used to get a PHP array from the fixed array. Syntax: array SplFixedArray::toArray() Parameters: This function does not accept any parameter. Return Value: This function returns a PHP array. Below programs illustrate the Sp 1 min read PHP SplFixedArray current() Function The SplFixedArray::current() function is an inbuilt function in PHP which is used to get the current entry of the array. Syntax: mixed SplFixedArray::current() Parameters: This function does not accept any parameter. Return Value: This function returns the current entry of the array. Below programs 1 min read Like