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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:50:22+00:00 2026-06-12T17:50:22+00:00

<?php echo getValue(‘<a>dk</a><b>sh</b>’, ‘a’); function getValue($string, $tagname) { $dom = new DomDocument(); $dom->loadXML($string); $node_list

  • 0
<?php

echo getValue('<a>dk</a><b>sh</b>', 'a');

function getValue($string, $tagname) {
    $dom = new DomDocument();
    $dom->loadXML($string);
    $node_list = $dom->getElementsByTagName($tagname)->item(0);
    return $node_list->nodeValue;
}

running the script returns

Warning: DOMDocument::loadXML(): Extra content at the end of the document in Entity, line: 1 in /Users/johnkim/get.php on line 7
  • 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-12T17:50:23+00:00Added an answer on June 12, 2026 at 5:50 pm

    Well, your xml string is not valid. Try to wrap it with any tag like:

    <some_tag><a>sdfsdf</a><b>sdfsdf</b></some_tag>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP echo function is not outputing strings in the format of html tag like
Why does IE complain about this javacript call? $.get(profile_completeness.php?id=<?php echo($user_id); ?>, function(data) { var
Here's my code: <html> <head> <?php function getValue($field){ if(isset($_GET[$field])){ return $_GET[$field]; } else{ return
Here's what I have: <html> <head> <?php $validForm = false; function getValue($field){ if(isset($_GET[$field])){ return
PHP Echo or Print functions does not show anything when php is busy with
when I am displaying(PHP echo) an image name from the server,it's shows like, Resource
Given hello.php: <?php echo Hello; ?> rendering the page works fine and returns Hello
For example… This PHP code <?php echo '<html>'; echo '<body>'; echo '<h1>Header One</h1>'; echo
using <?php echo $_SERVER['REQUEST_URI'] ;?> when the url is: www.site.com/a/b/c/#d does not show the
So I have a php file called Time.php: <?php echo (( $DateTime.date(n/j/Y g:i:s A).Hour

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.