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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:57:06+00:00 2026-05-31T00:57:06+00:00

I am retriveing data from a soap api using php. but unable to get

  • 0

I am retriveing data from a soap api using php. but unable to get the data in a array. Every time it gives me error

Fatal error: Cannot use object of type stdClass as array in

stdClass Object (

[item] => Array
    (
        [0] => stdClass Object
            (
                [date] => 2008-07-17T01:23:06Z
                [directory] => 1
                [downloadCount] => 0
                [downloadLink] => http://www.example.com/folder/8ISxjbEs/_online.html
                [empty] => 
                [id] => 8290268
                [md5] => 
                [name] => 
                [parentId] => -1
                [removed] => 
                [shared] => 
                [size] => 17
                [version] => 0
            )

        [1] => stdClass Object
            (
                [date] => 2009-11-03T23:03:15Z
                [directory] => 
                [downloadCount] => 5
                [downloadLink] => http://www.example.com/file/mIofv-vJ/MASTER-ACCOUNTS_3_Nov_2009.html
                [empty] => 
                [id] => 146103085
                [md5] => b073b9573227843e25d19e0e9e60ce80
                [name] => MASTER-ACCOUNTS 3 Nov 2009.zip
                [parentId] => 8290268
                [removed] => 
                [shared] => 
                [size] => 3401447
                [version] => 0
            )
  ) )

Ok i am using 4shared API.

//User credentials on 4shared

$user_login = "email_123@hotmail.com";
$user_password = "password";

$client = new SoapClient("https://api.4shared.com/jax2/DesktopApp?wsdl", array(
"cache_wsdl" => WSDL_CACHE_DISK,
"trace" => 1, 
"exceptions" => 0
)
); 

$client->yourFunction();
//Getting list of all folders 
echo "<pre>";

$getAllItems  = $client->getAllItems ($user_login, $user_password);

print_r  ($getAllItems);

this code is printing the above stdClass object. but i am unable to convert it into array.

  • 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-31T00:57:07+00:00Added an answer on May 31, 2026 at 12:57 am

    Have you tried converting using the get_object_vars(); function?

    <?php
    
    function objectToArray($d) {
        if (is_object($d)) {
            // Gets the properties of the given object
            // with get_object_vars function
            $d = get_object_vars($d);
        }
    
        if (is_array($d)) {
            /*
            * Return array converted to object
            * Using __FUNCTION__ (Magic constant)
            * for recursive call
            */
            return array_map(__FUNCTION__, $d);
        }
        else {
            // Return array
            return $d;
        }
    }
    
    ?>
    

    *I know it’s kinda late to answer but i came across this question while looking for a solution for my problem so here’s my 2 cents 🙂

    http://www.if-not-true-then-false.com/2009/php-tip-convert-stdclass-object-to-multidimensional-array-and-convert-multidimensional-array-to-stdclass-object/

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

Sidebar

Related Questions

When retrieving data from MySQL, the PHP array output has both numeric and name
I have a problem with retrieving data from a database using PHP statements. At
i am retrieving data from guardian web service using c#. The answer i get
Hi guys i am retrieving data from php using ajax , what i am
Traditionally when using a DbCommand when retrieving data from a sproc, something like the
Retrieving data from the REST Server works well, but if I want to post
I am getting the following error when retrieving data from a rest data source
i am using following webservices for retrieving data from server server side:.net client side:ksoap2
I retrieving data from a csv/txt file using oledb driver ConnString = Provider=Microsoft.Jet.OleDb.4.0; Data
I've been looking for PHP, SQL open scripts on retrieving data from DB according

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.