preg_match_all
-
I am using the code below to search for the first image in a post:
preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); if ( isset( $matches ) ) { $url = $matches[1][0]; }
I really want to search for the first image in a post that has an underscore “_” in the url, can this be done?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘preg_match_all’ is closed to new replies.