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!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I'll try to make this clear as i can. I want to search through an object and return match or no match depending on whether the object contains any data.
something like this
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Search through an object for what? An object can contain variables (usually called properties). You can "search" them in the same way you would any group of variables. If you want to see if the object exists then you would use isset().
get_class_vars() and get_object_vars() can be used to retrieve information on properties in classes and objects, respectively. It is possible to use preg_match() against the retrieved property names.