fork download
  1. <?php
  2.  
  3. $conteudonoticia = '[caption id="attachment_42478" align="alignleft" width="640"] <img class="wp-image-42478 size-full" src="http://paginalocal/wp-content/uploads/2016/12/20140815_174009.jpg" alt="20140815_174009" width="640" height="480" />Objetivo com a antecipação é garantir comodidade e tranquilidade aos servidores para as festas de final de ano[/caption]';
  4.  
  5. preg_match_all('#\bhttps?://[^,\s()<>]+(?:\([\w\d]+\)|([^,[:punct:]\s]|/))#', $conteudonoticia, $match);
  6.  
  7.  
  8. print_r($match[0]);
Success #stdin #stdout 0s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => http://paginalocal/wp-content/uploads/2016/12/20140815_174009.jpg
)