fork(28) download
  1. <?php
  2.  
  3. $imageTag = <<< LOB
  4. <img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" />
  5. <img border="0" src="/images/not_match_image.jpg" alt="Image" width="100" height="100" />
  6. LOB;
  7.  
  8. preg_match('%<img.*?src=["\'](.*?)["\'].*?/>%i', $imageTag , $result);
  9. $foo = $result[1];
  10. echo $foo;
Success #stdin #stdout 0.02s 24144KB
stdin
Standard input is empty
stdout
/images/image.jpg