let say i have this folder to store captcha image
$directory = "http://localhost/test/wp-content/plugins/test/captcha/";
i try alot of codes like opendir, glob() etc trying together my image file name from the directory above but fail.
image file name is captcha.jpeg.
i have no choice but to use static url as shown below. but my captcha will be generating images with random (name).jpeg that is why i need a dynamic way to get image file whereby *.jpeg
$directory="http://localhost/test/wpcontent/plugins/test/captcha/captcha.jpeg";
i wants to get the whole image url return as json. Please anyone have resource to help me thanks.
return array("image url" => $image_url);