I was getting below error so changed
opendir(http://test.myserv.com/Optfolder/upload/upload)
[function.opendir]: failed to open dir: not implemented
so changed to file_get_contents($dir)
But then in next I got this error
readdir(): supplied argument is not a valid Directory resource
What should I do?
I use below code to read folder images is there any option for opendir and readdir so ic an use them for my purpose?
In $dir I get full path like http://testserv.com/optfolder/upload
$dir = opendir($dir);
while ($file = readdir($dir)) {
if (preg_match("/.png/",$file) || preg_match("/.jpg/",$file) || preg_match("/.gif/",$file) ) {
$string[] = $file;
}
}
You can't use
opendir()
on HTTP urls. You need to specify a relative directory path instead. See opendir