From the following HTML i need to extract email address only to save it in database. I need to pull it in array, what i was planning is to use jquery/ajax to pull all email using dom and save it to another page using ajax ,but the problem is that
<td> have no unique identification with other <td> i.e i can do it if td has class or id name
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="100%" border="1">
<tr></tr>
<tr>
<td>NAME</td>
<td>ADDRESS</td>
<td>PHONE</td>
<td>EMAIL</td>
</tr>
<tr>
<td>wwqw</td>
<td>qww</td>
<td>ew</td>
<td>email@exmaple.com</td>
</tr>
<tr>
<td>e</td>
<td>wew</td>
<td>ew</td>
<td>emai1l@exmaple.com</td>
</tr>
<tr>
<td>e</td>
<td>ewe</td>
<td>we</td>
<td>email2@exmaple.com</td>
</tr>
<tr>
<td>we</td>
<td>we</td>
<td>we</td>
<td>emai3l@exmaple.com</td>
</tr>
<tr>
<td>ww</td>
<td>w</td>
<td>w</td>
<td>emai4l@exmaple.com</td>
</tr>
</table>
</body>
</html>
I need to grab email address and store in array like below
Array
(
[0] => email@exmaple.com
[1] => emai1l@exmaple.com
[2] => email2@exmaple.com
[3] => emai3l@exmaple.com
[4] => emai4l@exmaple.com
)
<td> can have variable class and id , so its very hard to use jquery etc to pull them. I am obstructed by it . Any help wil be appreciated
do not use jquery, regular expression will make your job easy.