开发者

php, data from object [closed]

开发者 https://www.devze.com 2023-01-08 01:15 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_StackOverflow Closed 12 years ago.

how get information from Object?

$cars = new Cars($car_color, $car_id, $car_speed); 
CAR_class::cars($cars, $car_speed); 

Thanks


get_object_vars() is a winrar. :-D


Assuming you just mean to access the $cars object's variables...

You should have some sort of getter function within your Car class that returns the object's variables. for instance:

public function getColor() {

     return $this->color;
}

Then you would call the function using something like:

$cars->getColor();
0

精彩评论

暂无评论...
验证码 换一张
取 消