Questions tagged [stdclass]

`stdClass` is php's generic empty class, kind of like Object in Java or object in Python.But not actually used as universal base class. Useful for anonymous objects, dynamic properties. It is used when casting other types to objects.

stdClass is php's generic empty class, kind of like Object in Java or object in Python.But not actually used as universal base class. Useful for anonymous objects, dynamic properties. It is used when casting other types to objects.

503 questions
-2
votes
2 answers

How can i read this stdClass object in php?

stdClass Object ( [api] => stdClass Object ( [results] => 1 [leagues] => stdClass Object ( [1] => stdClass Object ( [league_id] => 1 [name] => World Cup [country]…
-2
votes
2 answers

Undefined property: stdClass::$ecompany in C:\wamp64\www\try\insert.php on line 7

'; //Printing Array print_r($data); echo ''; //Getting values in…
Rohit Gautam
  • 312
  • 2
  • 17
-2
votes
1 answer

Converting a stdClass intro an array

stdClass Object ( [CountyId] => 3 [Name] => Alba [Abbreviation] => AB ) stdClass Object ( [CountyId] => 4 [Name] => Arad [Abbreviation] => AR ) stdClass Object ( [CountyId] => 5 [Name] => Arges [Abbreviation] =>…
Soptareanu Alex
  • 4,846
  • 4
  • 15
  • 15
-2
votes
2 answers

Extract complete array from std class multi dimensional array php

I am working on an exam system and I have run into a problem for getting the right result. I want this result from answers array which match question ID 466 ( [id] => 234 [firstChoice] => 2 [choice] => 2 [marked] => [strikethrough] =>…
Nasirsom
  • 11
  • 2
-2
votes
2 answers

sorting three dimensional array of stdclass objects in php

i'm having a problem sorting that array, i've tried few different methods of usort but nothing seems to be working. i want to order it by "vieworder". to print it i used the array_values() function this is the array: Array ( [0] => Array …
Shahaf Antwarg
  • 489
  • 3
  • 11
-2
votes
2 answers

Searching for values in JSON array w/ stdClass subarray

This JSON snippet is part of a WooCommerce order, extracted from the APIv2 get_order() function. The [meta] holds product variation data chosen by the customer. [meta] => Array ( [0] => stdClass Object ( [key] => pa_size [label] => Size [value]…
D. Simpson
  • 1,882
  • 17
  • 32
-2
votes
2 answers

stdClass Cannot use [] fatal error

I am attempting to iterate the img data held in the array within the stdClass object. I've been able to get the stdClass to do everything else I hoped, trying to get the images to sequence/iterate out has eluded me. I have looked at php.net and read…
Chezshire
  • 713
  • 5
  • 13
  • 32
-2
votes
3 answers

How to extract these values in PHP and show it in a table format?

How to display above values as page wise, sorting and searching options? stdClass Object ( [totalcdrcount] => 11 [cdrs] => Array ( [0] => stdClass Object ( …
Malli
  • 15
  • 5
-2
votes
1 answer

get all objects key value from nested array

hi i have an array of objects like as follow: stdClass Object ( [row_1_node_1] => stdClass Object ( [probality] => Array ( [0] => 0.6 [1] => 0.4 ) …
user2640758
  • 73
  • 1
  • 3
  • 11
-2
votes
1 answer

How can i access stdClass Object as a string

How can I access these lines like a string ? Its a get response from twitter, and im tring to use it. stdClass Object ( [relationship] => stdClass Object ( [source] => stdClass Object ( …
Emre Y
  • 51
  • 1
  • 7
-2
votes
1 answer

Call to undefined method stdClass::onDisplay() error

I have a joomla 2.5 installation. I just installed community builder component. when I tried to add a field, I got the error message: Fatal error: Call to undefined method stdClass::onDisplay() in…
Souleye
  • 9
  • 1
  • 2
-3
votes
1 answer

Is there a way to escape the "." character in php?

I have an stdClass object that I have dynamically created from a JSON using json_decode(). I am trying to access a field by calling $value->V.X->processedField but this field has a period. This is giving me a syntax error. Is there a way to somehow…
Caleb Collier
  • 71
  • 2
  • 9
-3
votes
1 answer

How extract @attributes from stdClass Object?

How i can extract the attributes from a stdClass Object? I have the variable $data. Doing a print_r to it i get: stdClass Object ( [@attributes] => stdClass Object ( [id] => cover [title] => Cover ) …
Marcello Impastato
  • 2,263
  • 5
  • 30
  • 52
-3
votes
2 answers

php object format from string

if i have an array like this $arr = [ [ 'id' => 2, 'name' => 'John', 'class' => 4, 'score' => 90], [ 'id' => 5, 'name' => 'Smith', 'class' => 5, 'score' => 30], [ 'id' => 7, 'name' => 'Sam', 'class' => 4, 'score' => 70], [ 'id' => 9,…
VirusEcks
  • 596
  • 1
  • 10
  • 14
-3
votes
1 answer

how can i echo individual elements from this array

i have an array which i obtained from database query using PDO::FETCH_OBJ. It contains users comment on a certain posts And i need to echo each individual values.How can i get the element values from this array? Array ( [0] => stdClass Object (…
AL-zami
  • 8,902
  • 15
  • 71
  • 130
1 2 3
33
34