I am not able to iterate through object vars[solved]

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

I am not able to iterate through object vars[solved]

Post by raghavan20 »

Code: Select all

foreach ( $CreditCard as $k => $v ){
				$this->rended_code .= "$k = $v<br>";
			}
I know for sure there is data in CreditCard object, but it displays nothing.
Even if I use get_object_vars() it returns nothing for any object.
I use PHP 5.
Last edited by raghavan20 on Mon Jun 05, 2006 2:50 pm, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

What access level are the properties of $CreditCard? If they aren't public, you won't find them.
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

yeah...all properties in mine are private and I have now found that I am not able to view those properties because of security....thanks feyd
Post Reply