function_exists within class

Posted on 2006-05-03
Last Modified: 2008-03-17

Say I have:

$className = "MyClass";
$theObj = new $className();
// Here I want to check if a function (say, MyFunc) is available in the MyClass class. If yes, call the function and perform some actions.

The scenario is quite complicated than explained here, but it should explain what I want to achieve. I know there is a function called function_exists(), but could that be used here? Or any other ideas?

Thank you all.
Question by:sangeetha
    LVL 29

    Accepted Solution

    In classes you use method_exists...
    LVL 2

    Author Comment

    Thank you.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to dynamically set the form action using jQuery.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now