I am trying to use php to get an image from an array in Drupal. At the moment when printing this array other variables are printed as well. What i need is a way to search this array for an image such as this ->
<img src="blah.jpg" alt="blah" />
and then save this as a separate variable. I’m unsure how to approach this sort of problem.
Perhaps a regex function or another in built php function?
I would class my knowledge as pretty low in php so please make your answer as simple as possible
Here, I found this (first result when you Google php regex img tag). This show you the required Regular Expression.
I don’t really get your whole array question, but this should probably be enough to achieve your goal!
Good luck!