Quick Links
Services
- Web Development
- Mobile Application Development
- System's Integration & Interfaces
- Web Design
- Web Audit
- Webhosting & Email Services
- Web Mastering
- Online Marketing Services
- Social Networking Services
- E-Commerce
- Search Engine Optimization (SEO)
- Multimedia CD Presentations
- Logo Design and Corporate Identity
- Quality Assurance
- Augmented Reality 3D AR
- 360° Virtual Tour
- Linguistic services (Copywriting, Translation, Proofreading)
Extract Image Source (Src) From HTML Content In PHP
This code will grab the first image source from an HTML content using preg_match_all method in php and regular expression
$strFirstImage = "";
$output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $strHTMLSourceContent, $ContentImages);
$strFirstImage = $ContentImages[1] [0]; // To grab the first image
echo $strFirstImage;
Comments:
0 Comments