note 31743 deleted from function.preg-match-all by sniper

From: Date: Tue, 30 Sep 2003 12:23:23 +0000
Subject: note 31743 deleted from function.preg-match-all by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-57438@lists.php.net to get a copy of this message
Note Submitter: amien@perwanalnumberten.com ---- here's how to retrieve image names from a html generator .. the purpose is to upload image files without an annoying browse buttons ... usually used in WYSIWYG editor .. function get_images_upload($string) { preg_match_all( '/\<img src=.*?\>/',$string,$tags ); for ($count = 0; $count < sizeof($tags[0]) ; $count++) { preg_match_all( '/\'.*?\'/', $tags[0][$count], $img ); for ($x = 0; $x < sizeof($img[0]) ; $x++) { $final_name[$x]=str_replace ("'"," ", $img[0][$x]); } } } $string="<img src='aa.jpg'>psakldpasdsad<img src='bb.jpg'>dfdsfsd<img src='cc.jpg'><b>dasd<img src='ddfdfds.jpg'>s</b><a href='php.net'>"; get_images_upload($string) output should be : aa.jpg bb.jpg etc..etc..

« previous php.notes (#57438) next »