get_items_count
get_items_count($path,$include_subfolders=false,$only_folders=false,$timeout=60); - this function is used to get the number of items in the specified folder
The function accepts parameters as input:
$path – path to the folder where elements will be counted (string). It can be either absolute or relative (relative to the script folder).
$include_subfolders – whether to include subfolders in the invoice (true - include, false - not include) .
$only_folders – count only folders (true - only folders, false - both folders and files) .
$timeout – maximum time to perform this operation (in seconds), by default - 60 seconds, if the operation is not completed during this time, the script continues to run further.
After testing, the function returns the result of its work to the script :
number of elements – the number of elements (folders and files) in the specified folder (string)false – there is no such folder (boolean)