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.

490 questions
-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
  • 586
  • 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
  • 7,637
  • 11
  • 53
  • 104
-3
votes
1 answer

How to access properties of a nested PHP object?

I'm trying to do an web app which people can see their status in League of Legends, but I don't even know how to do some things. I've got this class: stdClass Object ( [player] => stdClass Object ( [id] => xxxxxx …
Bunnyfufuu
  • 11
  • 3
-3
votes
4 answers

how to convert stdClass Object in to an array

I want to get the names of stdClass Object. "Array ( [0] => stdClass Object ( [id] => 179111965447818 [name] => foot ball ) [1] => stdClass Object ( [id] => 103992339636529 …
-3
votes
1 answer

how to add an array in stdClassObject php

I have an array like this: Array ( [0] => stdClass Object ( [id] => 1 [title] => ABC [sentece] => blablabla... [topic] => Science ) [1] => stdClass Object ( [id] => 2 [title] => DEF [sentece] => nomnomnom... [topic] => Technology ) How to add an…
bob
  • 417
  • 4
  • 8
  • 15
-3
votes
1 answer

Joomla get values from StdClass

Little qeustion here, since i'm having troubles with retreiving my data from Joomla component. I have two objects within my query result, now i am echoing it like…
JSkirMan
  • 3
  • 9
-4
votes
1 answer

Convert an array of objects with 1 value each into simple array PHP

I have an array of Objects , each object always gets 1 value. And I don't know the keys nor the length. $result = {array} [2] 0 = {stdClass} [1] email = "2" 1 = {stdClass} [1] email = "31" I have tried it with $emails = (array)…
Insasse
  • 163
  • 1
  • 8
-4
votes
1 answer

Get values stdClass Object PHP

stdClass source http://zerrax.fr/b/example.php $response->torrents[0]->[28]; ?? $response->torrents[0]->[0]; ??
-4
votes
1 answer

stdClass object information PHP

there's this stdClass thing in PHP: hi = "o"; echo $fakeobj->hi; See? Is this php4?
y2k
  • 59,444
  • 25
  • 58
  • 84
-4
votes
2 answers

Manipulate string in array of objects with php

I have array of stdClass : array (size=2) 0 => object(stdClass)[2136] public 'id' => string '1946' (length=4) public 'office' => string 'test' (length=4) public 'level1' => string 'test level 1' (length=12) 1 => …
Natan Shalva
  • 1,522
  • 2
  • 10
  • 11
1 2 3
32
33