stdclass Questions

4

Solved

I have an array of objects; running print_r() returns the output below; Array ( [0] => stdClass Object ( [sm_id] => 1 [c_id] => 1 ) [1] => stdClass Object ( [sm_id] => 1 [c_...
Vino asked 4/12, 2012 at 16:50

3

Solved

I use this to check if an object has properties, function objectHasProperty($input){ return (is_object($input) && (count(get_object_vars($input)) > 0)) ? true : false; } But then I ...
Mayorga asked 12/10, 2013 at 13:24

1

Solved

stdClass Object ( [ModuleAccountInfo] => Array ( [0] => stdClass Object ( [ServerName] => EAST [HostingModule] => ActiveDirectory [ActiveDirectorySiteName] => EAST [Acco...
Motorbike asked 10/10, 2013 at 0:5

1

Solved

I'm trying to parse this data that is returned from SmartyStreets (it's an address verification company). Here is an example: Array ( [0] => stdClass Object ( [input_index] => 0 [candidat...
Deluca asked 5/5, 2013 at 0:12

3

Solved

I'm trying to get the twelve ids that this structure shows: stdClass Object ( [checkins] => stdClass Object ( [count] => 12 [items] => Array ( [0] => stdClass Object ( [venue...
Neology asked 1/3, 2011 at 15:52

3

Solved

Here is my code: <?php $madeUpObject = new \stdClass(); $madeUpObject->madeUpProperty = "abc"; echo $madeUpObject->madeUpProperty; echo "<br />"; if (property_exists('stdClass', ...
Expiratory asked 1/2, 2013 at 21:6

5

Solved

I'm currently working with the Codeigniter framemwork. In the code below, I would like to get an Animal_model object, not a stdClass Object. <?php class Animal_model extends CI_Model{ var $id...
Bernardabernardi asked 17/12, 2012 at 14:38

4

Solved

If print_r($object) returns stdClass Object ( [*] => sometext ) How do I get the property of the asterisk, i.e $object->*?
Doby asked 12/9, 2012 at 6:36

1

Solved

I'm working against an API that gives me an stdClass object that looks like this (actual data replaced) "data": [ { "type": "image", "comments": { "data": [ { "created_time": "1346054211", ...
Lizzettelizzie asked 27/8, 2012 at 8:50

4

Solved

I would like to be able to do the following: $obj = new stdClass; $obj->status = "success"; $obj2 = new stdClass; $obj2->message = "OK"; How can I extend $obj so that it contains the prop...
Colangelo asked 16/4, 2010 at 11:55

2

Solved

I'm working on this PHP code collaboration and it seems that some people access PHP StdClass fields like this $body->head and others like $body->{'head'} As far as I can tell these ar...
Crystallite asked 18/4, 2011 at 8:17

1

Solved

Would anyone happen to know if it's possible to set a namespace on a user-defined stdClass object. What I would like to do is to return all the private properties of a class as an object in the fo...
Nomothetic asked 2/2, 2012 at 14:23

2

This is my first time posting, so forgive me if I'm not very clear. I will also preface this by saying that I really know very little about php and web services. The issue I'm having is this: A S...
Etiology asked 24/6, 2011 at 21:16

3

Solved

I'm pulling records from database, and I have a filed called content_fr the _fr is being dynamicaly created based on a site language. Getting all records from the table gives me of course content_...
Diu asked 27/11, 2011 at 19:37

1

Solved

Could anyone shed any light as to why I can get this working. I want to query an array to see if the USER->id that is currently logged in is assigned a specific role: $contextroles = get_record...
Swore asked 1/9, 2011 at 13:37

6

Solved

When I create a standard class I mostly do: $test = null; $test->id = 1; $test->name = 'name'; However in strict-mode I get an error. So obviously the correct way of doing it is: $test =...
Active asked 21/7, 2011 at 19:1

4

Solved

I have some json object that I decoded, and one of the attributes starts with an "@" and I can't access the element with php because it throws an error. [offers] => stdClass Object ( [@attri...
Gervais asked 11/1, 2011 at 17:2

3

Solved

I was having a question about making a 2D JSON string Now I would like to know why I can't access the following: $json_str = '{"urls":["http://example.com/001.jpg","http://example.com/003.jpg","h...
Primero asked 2/11, 2010 at 18:11

6

Solved

I'm struggling to parse the below data using PHP. An API returns it, and I've tried various syntaxes. How do I return the data in a non-object way? Or, what's the syntax to call the data using the ...
Greenleaf asked 14/10, 2009 at 17:10

3

Solved

Is it it possible to do this in php? Javascript code: var a = {name: "john", age: 13}; //a.name = "john"; a.age = 13 Instantiate the stdClass variable on the fly ?
Beal asked 29/10, 2009 at 17:43

© 2022 - 2024 — McMap. All rights reserved.