Obi1-Cannabis Posted January 25, 2007 Share Posted January 25, 2007 is it possible to have a object property where the name of the property contais a variable?i don't know if i waas explicit i'll show some code to see if you get the idea: while($image==null){$num = rand(1,6);$image=$row->foto($num);} or something that makes this possible... Link to comment Share on other sites More sharing options...
Obi1-Cannabis Posted January 25, 2007 Author Share Posted January 25, 2007 nah.. didnt think so... Link to comment Share on other sites More sharing options...
justsomeguy Posted January 25, 2007 Share Posted January 25, 2007 All of these are possible: $obj->prop;$obj->prop[$var];$obj->prop['str' . $var];$obj->$var;$obj->method($var); It depends what you are trying to do. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now