Create Object and get its type : Data Type « Data Type « PHP






Create Object and get its type


<?php
  class employee {
      var $emp_code;
      var $name;
      var $address;
      var $department;
      var $sex;
      var $date_of_birth;
      var $salary;
  }

  $dave = new employee;
  $alice = new employee;

  echo gettype ($dave)," \n";
  echo gettype ($alice), " \n";
  ?>
           
       








Related examples in the same category

1.PHP Data Types
2.gettype() and settype() Data Types
3.Returns true if $a is an array
4.Returns true if $a is a floating-point number
5.Returns true if $a is an integer
6.Create Object and check its type
7.Returns true if $a is a string
8.is_numeric in action