Searching an object for a value (like in_array) |
[eluser]tdktank59[/eluser]
Is there a way to do this with objects. Im not sure thus why im asking. Otherwise ill try/use in_array and hope it works lol
[eluser]bretticus[/eluser]
You can use the PHP5 functions get_class_vars() and get_class_methods() to make associative arrays to search in or even use method_exists() or property_exists() to search for them directly.
[eluser]tdktank59[/eluser]
Allright new question! So ive got an object/array called $this->user_permissions Heres what it contains Quote:stdClass Object I need to search this for $class->$method (both are defined. where its Type => Class => Method in the array structure above I guess I can go through it but im trying to find a more efficient way to check if I have access |
Welcome Guest, Not a member yet? Register Sign In |