PHP Coding Solutions

php coding solution, form validation

Saturday, August 30, 2014

Getting the first image in string with php


<?php
    $texthtml = 'Who is Sara Bareilles on Sing Off<br>
    <img alt="Sara" title="Sara" src="475993565.jpg"/><br>
    <img alt="Sara" title="Sara two" src="475993434343434.jpg"/><br>';
    preg_match('/<img.+src=[\'"](?P<src>.+)[\'"].*>/i', $texthtml, $image);
    echo $image['src'];
?>
Posted by Magento at 3:37 AM No comments:
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ►  2020 (1)
    • ►  June (1)
  • ►  2019 (7)
    • ►  July (2)
    • ►  June (2)
    • ►  May (1)
    • ►  April (2)
  • ►  2018 (5)
    • ►  October (4)
    • ►  September (1)
  • ►  2017 (7)
    • ►  October (1)
    • ►  June (1)
    • ►  May (3)
    • ►  April (1)
    • ►  March (1)
  • ►  2016 (7)
    • ►  December (1)
    • ►  November (1)
    • ►  August (2)
    • ►  June (1)
    • ►  March (2)
  • ►  2015 (9)
    • ►  December (1)
    • ►  November (1)
    • ►  September (3)
    • ►  July (1)
    • ►  June (1)
    • ►  May (1)
    • ►  February (1)
  • ▼  2014 (11)
    • ►  September (1)
    • ▼  August (1)
      • Getting the first image in string with php
    • ►  April (2)
    • ►  March (4)
    • ►  January (3)
  • ►  2013 (13)
    • ►  December (3)
    • ►  November (1)
    • ►  September (4)
    • ►  August (4)
    • ►  July (1)

About Me

Magento
View my complete profile
Simple theme. Powered by Blogger.