I used the code given below to take the count of files in a folder which is in another machine. On my localhost the glob() is working fine, BUT on the server it displays the array size as 0.

$dir_path ="http://192.168.0.202/img/$sub_code/$sub_code".N."$churunano/*.jpg*";
$count = count(glob($dir_path));



How to find the count of the files?

Note: This function will not work on remote files as the file to be examined must be accessible via the server's filesystem.

Taken from: http://php.net/glob

What you could do is put a script with glob on that server, and retrieve the result using cUrl.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.