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
-1
votes
1 answer

how to print stdclass object name to data

i used ezsql mysqli and my mysql scheme: id---settingname------settingcode --------------------------------- 0 doctype 1 html_lang en 2 charset utf8 and my php code
Koray
  • 11
  • 5
-1
votes
1 answer

PHP Access StdClass's within an athor StdClass

How to access to StdClass's element who is within an athor StdClass. this is what var_dump return: stdClass Object ( [return] => stdClass Object ( [barCode] => 530884HB|4320000007;502241VA|4320000008; [code] =>…
-1
votes
1 answer

How to convert a String containing name-value pairs into an associate array or some other structure which supports name-value pairs?

I have a string that looks like this: {"red":216.77,"blue":0.669,"green":0.545,"alpha":1} I want to save it in either an array like this: array( "red" => 216.77, "blue" => 0.669, green" => 0.545, "alpha" => 1 ) or some other structure…
Solace
  • 8,612
  • 22
  • 95
  • 183
-1
votes
1 answer

PHP skip iterate in array stdClass

I´m iteration successfully through a large array that combines arrays and stdClass using the following code: foreach ($arr as $A) { $THIS=$A->w->b; } Here is an example of the array I'm iterating through: Array ( [0] =>…
-1
votes
1 answer

get the data of an array in a stdClass Object

I'm a novice programmer and I'm a bit lost rigth now. I would like to get the data from "gameId" and save it into a variable. printing $recentgames: print_r($recentgames); returns me this: stdClass Object ( [summonerId] => 40300606, …
juan fran
  • 359
  • 3
  • 12
-1
votes
1 answer

How php get one or more array value from stdClass object

Array ( [status] => OK [result] => Array ( [0] => stdClass Object ( [id] => 1 [name] => normal [points] => 1.00 [max_size] =>…
Sky
  • 29
  • 5
-1
votes
1 answer

How to get the property of stdClass php

I want to get the property of [code]. To save in a variable $co=[code]; Any idea? stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [message] => Invalid or expired token [code]…
CCA
  • 39
  • 7
-1
votes
1 answer

Get values from STDClass Object and create new array

I need to pull the ShipQty from each of the following STDClass Objects and insert it into a new array. Array ( [0] => stdClass Object ( [PRODUCTID] => 2 [ORDERID] => 7 [SHIPQTY] => 3 [STATUS] => 1 [SHIPDATE] => 2013-12-18 ) [1] => stdClass Object (…
user2436953
  • 45
  • 3
  • 9
-1
votes
2 answers

How to access values from stdClass in php

print_r($result); prints the below stdClass Object ( [result] => stdClass Object ( [insertCount] => 0 [updateCount] => 1 [rejectedCount] => 0 [totalCount] => 1 [errorMessage]…
s-hunter
  • 24,172
  • 16
  • 88
  • 130
-1
votes
1 answer

Access this STDCLASS object in php

How to access objects with @ sign in stdclass i have tried this in php with curl: $response->HotelListResponse->customerSessionId (this works) but when i do something like this: $response->HotelListResponse->HotelList->@activePropertyCount return…
-1
votes
2 answers

std class object array

I am getting this array of std class object how can i call it in single array as you can see only some values are changed. Array ( [0] => stdClass Object ( [movie_id] => 4 [movie_name] => Harvey …
Fawaz
  • 3
  • 2
-1
votes
1 answer

Getting strings from stdClass

I'm trying to get my latest tweets to display on my webpage and found and am using this peice of code.
Flatlyn
  • 2,040
  • 6
  • 40
  • 69
-1
votes
2 answers

Can I populate an object from a db but still have access to its methods?

This is my second post today because I'm very new at OOP in PHP, so bear with me if it's a silly question... I've created a beautiful class that I want to be able to use with my "JOB" objects that includes being able to use this single object to…
DevlshOne
  • 8,357
  • 1
  • 29
  • 37
-2
votes
2 answers

Create function that checks isset and returns null if not

I have the following issue. I want to access a property of an object which may or not be there. Consider this: $items[] = [ 'color' => $row->color ]; But color may or not be set on $row when it's not PHP prints a notice that it is something like…
WillD
  • 5,170
  • 6
  • 27
  • 56
-2
votes
1 answer

How to set a namespace to the instance of stdClass?

I need to change the type of object from stdClass to "myClass", so like does PDO::fetch_object("myClass"); $inc = new stdClass; $inc = funct_for_set_type_of_object("myClass"); // here the function to do …
Ax.
  • 320
  • 3
  • 4
  • 12