Automatically Get Images on Post Content

post_content;
$soImages = '~]*\ />~';
preg_match_all( $soImages, $soContent, $thePics );
$allPics = count($thePics[0]);
if( $allPics > 0 ) {
    echo $thePics[0][0];
}
else {
    echo "No IMG!";
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.