-1
Hello, good morning! All right? I need to set up a media gallery for a certain image extension ('.jpg') and I’m having difficulty counting the files ($key) in the value field (ds_midia_link). How should I proceed?
Thanks in advance,
[midias] => Simplexmlelement Object ( [media] => Array ( [0] => Simplexmlelement Object ( [id_image] => 5a29842d8ec9f [ds_imagem_credi] => Google [ds_image] => Black Panther [ds_imagem_link] => http://portal.interno.com.br//_midias/jpg/example.jpg
[1] => SimpleXMLElement Object
(
[id_imagem] => 5a29842d8ec9f
[ds_imagem_credi] => Google
[ds_imagem] => Pantera
[ds_imagem_link] => http://portal.interno.com.br//_midias/jpg/exemplo1.jpg
[2] => SimpleXMLElement Object
(
[id_imagem] => 5a29842d8ec9f
[ds_imagem_credi] => Google
[ds_imagem] => Pantera
[ds_imagem_link] => http://portal.interno.com.br//_midias/jpg/exemplo2.jpg
I get it. The problem is that my array I can have media of type image with another extension (e.g. png, gif, etc)... would have as I refine by file extension?
– Diego Albuquerque
Ai you will have to go through the array of a better example then, type you will have some key in the array that will be extension?
– arllondias
I would need to get to $value from $key ['ds_imagem_link'] scroll through it and check if it has a certain extension...
– Diego Albuquerque