i'd like to extract from a string like this :
<div id='pippo'><p><img src='pluto' alt='paperino'/><img src='pluto' alt='pippo'/><img src='pluto' alt='topolino'/></p></div>
a string like this :
paperino pluto topolino (only the content of the alt tag
How can i do this with php regex ?
Thanks i'm a newbie of regex
extracting the content of alt from img
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: extracting the content of alt from img
This would probably work:
Code: Select all
/alt='([^']+)'/mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.