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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:05:23+00:00 2026-06-11T02:05:23+00:00

I would like to print out depth 17 – 1 enclosed by 20m contour

  • 0

I would like to print out "depth 17 - 1 enclosed by 20m contour "

Below is xml string loaded from a xml file version 1.0 by $xml = simplexml_load_file("test.xml");

<object>
  depth 
 <emphasis>
  17 
   <subscript>1</subscript> 
 </emphasis>
  enclosed by 20m contour 
</object>


print_r($Vals->object);
//prints "depth enclosed by 20m contour "


$Vals->object->emphasis.' - '.$Vals->object->emphasis->subscript
//prints "17 - 1"

I can print string by replacing the values "depth" with depth $Vals->object->emphasis.' - '.$Vals->object->emphasis->subscript. Its not the good thing becoz there may also have a ‘depth’ in string and also width may have at the location of depth.

Till now i am trying with below code, Saw at Go to Question

echo dom_import_simplexml($Vals->object)->textContent;

This code could not do the job and also make the system to so slow. No error generating.

  • 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-11T02:05:24+00:00Added an answer on June 11, 2026 at 2:05 am

    You are looking for strval.

    Given this code:

    $xml = simplexml_load_file("test.xml");
    

    You can do:

    print strval($xml->emphasis->subscript); // prints '1'
    print strval($xml); //prints 'depth enclosed by 20m contour'
    ...
    

    And so on, you can combine them yourself to the string you want.

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

Sidebar

Related Questions

I would like to use echo in bash to print out a string of
I would like to print an array to a file. I would like the
In java i would like to read a file line by line and print
I would like to be able to print out all results for a query
I would like to print out the data, for debugging purpose. Data format would
I've got a C python extension, and I would like to print out some
I would like to ask how to print out this array with organize way
I am wondeirng how to print out all the system variables. I would like
I would like print out a list of names, each name only once. The
I have a struct and would like to print out the contents within quotes

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.