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

  • Home
  • SEARCH
  • 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 625295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:17:39+00:00 2026-05-13T19:17:39+00:00

As recommended in a previous question of mine, I am using the PHP Simple

  • 0

As recommended in a previous question of mine, I am using the PHP Simple HTML DOM Parser
as a way to search an HTML document and grab contents from a specific element (in my case, a textarea). I was wondering if anyone had used this before and was able to give me any advice for my problem (or recommend another solution). The code I’m using looks like this:

include "../simple_html_dom.php";
$html     = file_get_html('http://example.com');
$textarea = $html->find('textarea[id=body]'); 
$contents = $textarea->outertext;

echo $contents;

My problem is that the script runs the code and retrieves no data from the element (which looks like this:

<textarea id="body" name="body" rows="12" cols="75" tabindex="3">
At 2/21/10 10:15 PM, You wrote
: Hello world,
: how are you today?

</textarea>

I’m sorry to ask for advice with this certain method, but if anyone else has any advice it would be greatly appreciated. Thank you so much in advance

  • 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-13T19:17:39+00:00Added an answer on May 13, 2026 at 7:17 pm

    As you can see in the documentation find returns an array, so for starters you shouldnt treat it as if it were a node. Also, what you want is innertext not outertext.

    This should work:

    include "../simple_html_dom.php";
    $html     = file_get_html('http://example.com');
    $textarea = $html->find('textarea[id=body]'); 
    $contents = $textarea[0]->innertext;
    
    echo $contents;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On Previous Question , someone recommended that I install Andy's IDE Fix Pack to
In an answer to a previous question somebody recommended: have the SqlConnection a member
In a previous SO question it was recommended to me to use callback/event firing
Recommended by the ASP.NET team to use cache instead of session, we stopped using
In previous question I got comment about Oracle statistics: Oracle doesn't know that 50M
In a previous question I wrote about a javascript date function that was mysteriously
This is a follow-up to this question . I'm currently writing a simple game
This is an error that came up after I got a previous question here
what is the recommended way to handle self-referencing foreignkey constraints in SQL-Server? Table-Model: fiData
Any recommended practices for cleaning up header spaghetti which is causing extremely slow compilation

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.