Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7979563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T09:48:36+00:00 2026-06-04T09:48:36+00:00

From the following HTML i need to extract email address only to save it

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T09:48:37+00:00Added an answer on June 4, 2026 at 9:48 am

    do not use jquery, regular expression will make your job easy.

    $string='<!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>';
    echo "<pre>";
    $pattern="/([\s]*)([_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*([ ]+|)@([ ]+|)([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,}))([\s]*)/i"; 
    preg_match_all($pattern, $string, $matches);
    print_r($matches[0]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From the following HTML I need to figure out which List tag has class
I'm trying to use Qt to download the html code from the following url:
I have the following html and I want to use jQuery to toggle the
I need to extract the src element from all image tags in an HTML
I have this XML file I need to extract the HTML Code from mono
I'm using the following html to load dojo from Google's hosting. <script src=http://www.google.com/jsapi></script> <script
I have the following HTML structure being returned from an AJAX request... <th scope=col
I'm trying to parse a title from the following piece of html: Website (Newton)
Is the following From header incorect? // To send HTML mail, the Content-type header
From this site: http://www.toymaker.info/Games/html/vertex_shaders.html We have the following code snippet: // transformations provided by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.