2
I am trying to recover images from a folder with native php function glob
, only one is returning array emptiness.
I’m passing the full path from folder to function.
Follows code:
$pasta = get_template_directory_uri() . '/img/projetos/' . get_post_meta($post->ID, 'projeto', true) .'/';
$imagens = glob("$pasta{*jpg,*png}", GLOB_BRACE) or die ("Erro ao acessar $pasta");
Please report the error that is happening.
– Ricardo
What is the value of the concatenation "$folder{*jpg,*png}"? Can you print and post here? This notation you are trying to use I only know in shell, in regex I would do something like (jpg|png).
– Diego Souza