Write a PHP script to demonstrate the introspection for examining class(use function get_declared_classes() ,get_class_methods() and get_class_vars()).

<?php
classMyclass
          {
public $a;
public $b=10;
public $c='ABC';
functionMyclass()
            {
              //Myclass function
            }
function myfun1()
            {
               //functin
            }
function myfun2()
            {
               //functin
            }
          }
$class=get_declared_classes();
foreach($class as $cname)
{
echo"$cname<br>";
}
echo"<br>Class Methods are : <br>";
 $m=get_class_methods('Myclass');
foreach($m as $mname)
{
echo"$mname<br>";
}
$cp=get_class_vars('Myclass');
echo"class variables are :<br>";
foreach($cp as $cpname => $v)
{
echo"$cpname : $v <br>";
}
?>

Comments

Popular posts from this blog

Create an XML file which gives details of books available in “ABC Bookstore” from following categories. 1)      Technical 2)      Cooking 3)      Yoga And elements in each category are in the following format.     …….     …….     ……. Save the file as “Book.xml” Create an application that reads “Book.xml” file into simple XML object. Display attributes and elements. (Hint:- Use simple_xml_load_file() function). 

Write a simple PHP program which implements Ajax for addition of two numbers

Consider the following relational database: Project (P_Group_No, Project_Title) Student (Seat no, Name, Class, P_Group_No) Write a PHP script to accept project title and display list of students those who are working in a particular project.