I am using the code below to search for the first image in a post on a Wordpress blog:
[php]preg_match_all(’/<img.+src=’"[’"].*>/i’, $post->post_content, $matches);
if ( isset( $matches ) ) {
$url = $matches[1][0];
}
[/php]
I really want to search for the first image in a post that has an underscore “_” in the url, can this be done?