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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:26:52+00:00 2026-06-09T05:26:52+00:00

I have this string array(8) { [2]=> object(stdClass)#871 (2) { ["access"]=> int(0) ["value"]=> string(4)

  • 0

I have this string

array(8) {
    [2]=> object(stdClass)#871 (2) {
        ["access"]=> int(0)
        ["value"]=> string(4) "Male"
    }
    [3]=> object(stdClass)#872 (2) {
        ["access"]=> int(0)
        ["value"]=> string(2) "21"
    }
    [4]=> object(stdClass)#874 (2) {
        ["access"]=> int(0)
        ["value"]=> string(4) "sdad"
    }
    [10]=> object(stdClass)#861 (2) {
        ["access"]=> int(0)
        ["value"]=> string(0) ""
    }
    [11]=> object(stdClass)#873 (2) {
        ["access"]=> int(0)
        ["value"]=> string(11) "fds"
    }
    [17]=> object(stdClass)#875 (2) {
        ["access"]=> int(0)
        ["value"]=> string(11) "aaa"
    }
    [19]=> object(stdClass)#876 (2) {
        ["access"]=> int(0)
        ["value"]=> string(4) "this!!!"
    } [29]=> object(stdClass)#878 (2) {
        ["access"]=> int(0)
        ["value"]=> string(3) "sda"
    }
}

How to get string which value is ‘this!!!’?
I want to save value on that place to database.

  • 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-09T05:26:53+00:00Added an answer on June 9, 2026 at 5:26 am

    First of all, let’s get one thing straight. You don’t have a string. You have an array of objects. It is not possible (in PHP) to convert objects or arrays to strings.

    If you need the value at a particular index of an array, use $array[$index];.

    If you want the value of a particular attribute of an object, simply use $object->attribute;, or if you want the return value from a function, use $object->function();.

    In your case:

    For argument’s sake, let’s say you want to save the value attribute for the object at array index 10. The value there is

    [10]=> object(stdClass)#861 (2) {
        ["access"]=> int(0)
        ["value"]=> string(0) ""
    }
    

    So in order to access the string value for the value attribute of that object, you would write:

    $val = $array[10]->value;
    

    Or, if you want the string value for the value attribute of ALL objects, you could loop through your array with a foreach

    foreach($array as $obj) {
        $val = $obj->value;
        $access = $obj->access;
    
        // do something with $val and/or $access
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have this Hello.scala. object HelloWorld { def main(args: Array[String]) { println(Hello,
I have an array like this (below is the var_dump) array 0 => object(stdClass)[11]
As a service result I have this array: array(1) { [0]=> object(stdClass)#322 (2) {
I have this situation: object(stdClass)#203 (1) { [1]=> object(stdClass)#212 (7) { [user_id]=> int(1) [type]=>
I have this simplexml result object: object(SimpleXMLElement)#207 (2) { [@attributes]=> array(1) { [version]=> string(1)
i have array+object like this. Array ( [0] => stdClass Object ( [tid] =>
I'll have my PHP like so: array(2) { [0]=> object(stdClass)#20 (1) { [name]=> string(5)
I have this array: string[,] productData = new string[5,7]; I bind it to a
I have this string of numbers var array = 1,6,2,9,5 which is retrieved from
Basically I have this string $str=word1 word2 word3; I need array( 'word1', 'word2', 'word3'

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.