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 5960001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:45:52+00:00 2026-05-22T18:45:52+00:00

Folks, I tired all my PHP skills to extract domain name strings from a

  • 0

Folks,

I tired all my PHP skills to extract domain name strings from a RSS Feed and put each domain name as an array element, but all in vain:

Here is the RSS: http://bulliesatwork.co.uk/master/dev/domp/expdom/domains.php

Do you see a list of domain names, which are anchored? All I need is to extract these domain names like “abc.co uk”, (there is a space between .co and .uk), which can be
removed with str_replace).

Here is my first try: (Using SimpleHTMLDomParser)

require_once('simple_html_dom.php');

$html = file_get_html('http://bulliesatwork.co.uk/master/dev/domp/expdom/domains.php');

$domains = $html->find('div[class="entry"] a', 0);

foreach($domains as $dom)
{        
    echo str_replace(' ', '.', $dom->plaintext);
} 

$html->clear();
unset($html);

Here is my another try with DOM Document:

$scrapeurl = 'http://bulliesatwork.co.uk/master/dev/domp/expdom/domains.php';         

$keywords = file_get_contents($scrapeurl);

$keywords = json_decode($keywords);

foreach( $keywords->responseData->results as $keyword) 
{    
    echo str_replace("...",".",$keyword->title).'<br/>';  
}

In both the cases, DOMDocument is created but it seems the Document has all information except the domain names I want to extract.

Please help me out to extract the domain names.

Cheers.

  • 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-05-22T18:45:52+00:00Added an answer on May 22, 2026 at 6:45 pm

    Try this:

    $xmlobj=simplexml_load_string(file_get_contents("http://bulliesatwork.co.uk/master/dev/domp/expdom/domains.php"));
    
    $res = $xmlobj->xpath("/rss/channel/item/title");
    $names = array();
    while(list( , $node) = each($res)) {
      $names[] = (string)$node;
     }
    

    $names has all the names you want: you’ll need to do the string replace yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Folks, we all know that IP blacklisting doesn't work - spammers can come in
Hey folks - I'm writing a pretty simple iPhone application. The data comes from
Hello all you helpful folks @ stackoverflow! Best resources for Java GUI's? Looking at
First of all thanks to folks who are currently involved in the development of
folks, from the following code int a = mysql_query(conn,INSERT into data VALUES (NULL,'tes','aja')); how
Folks, Lets say I store three new instances of object Car using CallContext.SetData() from
Hey folks, I've migrated a site from WordPress to a new CMS, and I
Folks, I need a solution that allows drag-and-drop cell over the table. The cells
Folks, I'm working on a little piece of rich client software that I'd like
Folks, I connect to a large number of SQL Server 2005 databases through SQL

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.