Support

Account

Home Forums General Issues Get first image from a WYSIWYG field Reply To: Get first image from a WYSIWYG field

  • If you need it in the same loop when you go through the repeater then you could try this:

    preg_match('/<img.+src=[\'"](?P<src>.+?)[\'"].*>/i', $texthtml, $image);
        echo $image['src'];

    Where of course the $texthtml is your WYSIWYG field.