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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:33:12+00:00 2026-05-30T20:33:12+00:00

Hello i have this part of php code $google_url = http://uclassify.com/browse/uClassify/Sentiment/ClassifyText?readkey=jnsdnjdsnjnjsdnjsnjdsd&text=.$text.&version=1.01; $result = file_get_contents($google_url);

  • 0

Hello i have this part of php code

    $google_url = "http://uclassify.com/browse/uClassify/Sentiment/ClassifyText?readkey=jnsdnjdsnjnjsdnjsnjdsd&text=".$text."&version=1.01";

    $result = file_get_contents($google_url);


$obj = simplexml_load_string($result);

$zaab = toArray($obj);

echo($zaab);

and the answer i get is

<?xml version="1.0" encoding="UTF-8" ?>
<uclassify xmlns="http://api.uclassify.com/1/ResponseSchema" version="1.01">
    <status success="true" statusCode="2000"/>
    <readCalls>
    <classify id="cls1">
        <classification textCoverage="0.6">
            <class className="negative" p="0.999984"/>   <-----p_value
            <class className="positive" p="1.60692e-005"/>     <-----p_value
        </classification>
    </classify>
    </readCalls>
</uclassify>

how can i access p_values?

no after updating it gives me an error having to do with toArray()

  • 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-30T20:33:13+00:00Added an answer on May 30, 2026 at 8:33 pm

    You can get the all *p*s attribute values by looping through all *class*es like this:

    $classes = $obj->readCalls->classify->classification->class;
        foreach ($classes as $class) {
            $p_val = $class->attributes()->p;
            echo $p_val . "<br />";
        }
    

    I see you also tried to convert the xml string to array, probably the simplest way to do it is:

    $json = json_encode($obj);
    $xml_array = json_decode($json,TRUE);
    

    To see the results use:

    echo "<pre>";
    print_r($xml_array);
    echo "</pre>";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have this code: <?php class hello { var $greeting = hello;
hello i have this part of my code: static void Main(string[] args) { Console.WriteLine(Memory
Hello i have this form filling javascript: function onLine(code,nn) { document.writeform.bericht.value+=code; document.writeform.bericht.focus(); document.writeform.nickname.value+=nn; write1();
Suppose I have this code: String encoding = UTF-16; String text = [Hello StackOverflow];
Problem Hello all! I have this code which takes my jpg image loops through
In one PHP file, I have this code: require_once $_SERVER['DOCUMENT_ROOT'] . '/custom/functions.php'; global $testVar;
When I have this PHP script. <?php exec('/usr/local/bin/mate hello.txt'); ?> It doesn't work on
Hello I have tried understanding what is going on in this part of the
Hello I have this list that i am working on. When i move the
I have this kinda template text : Hello {#Name#}, Thanks for coming blah on

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.