I'm trying to use Simple HTML DOM Parser to look at the content of my WordPress posts and move all images to the end of the post, regardless of where they are in the actual html.
I've successfully isolated all the images using:
$html = str_get_html(wpautop(get_the_content()));
foreach($html->find('img') as $element) echo $element->src . '<br>';
as per the documentation. (This just prints the image sources as per the example given on the site as I'm still experimenting).
However, I couldn't figure out how to find all elements except images - the documentation has options for finding elements without an attribute, but that doesn't seem to apply.
I could select multiple elements like so:
$ret = $html->find('a, p');
...but then I'd have either have to guess at which tags were going to be used, or include every tag that isn't an img, which would be a huge and unreliable list. Is there any way around this?