Skip to main content

Extends class in php with multiple object

 Extends class in php with multiple object  


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>oops in php by saddam</title>
</head>

<body>
creat many  object in one class



<?php

class collage
{

public $name, $age, $clss,$address;
function __construct($n,$a,$c,$ad)
    {
        $this->name=$n;
        $this->age=$a;
        $this->clss=$c;
        $this->address=$ad;
     }


}
class student extends collage
{
    function __construct( )
    {
       
        parent::__construct("saddam","15","12","delhi");
    }
    function index()
    {
        echo "</br></br>saddam used OWERWRITE code for __construct function and parent keyword</br></br>";
       
        }
       
}
   $obj1= new student;
   $obj1->index();
   
?>
output:- should be like this :-


saddam used OWERWRITE code for __construct function and parent keyword;
</body>
</html>

Comments

Popular posts from this blog

Minimum and maximum number with - and + 500 in Mysql and Sql query and Find out table scheema of our database in Mysql and sql query and Find out all table name of our database in Mysql and sql query and Find out current date and time in mysql and sql help of sql query

Minimum and maximum number with - and + 500 in Mysql and Sql query:- syntax:-  SELECT MIN(Used)-500 , max(Used)+500 FROM audit Find out current date and time in mysql and sql help of sql query:- syntax:- SELECT now() Find out database name in Mysql and sql query:- syntax:-  SELECT DATABASE(); Find out all table name of our database in Mysql and sql query:- syntax:- SHOW TABLES; Find out   table scheema   of our database in Mysql and sql query:- syntax:- DESCRIBE <table name>;

PHP STRING FUNCTION WITH OUTPUT AND EXAMPLE

PHP STRING FUNCTION  WITH OUTPUT AND EXAMPLE  <?php   $var="my name is saddam hussain saifi ";   print_r(explode("a",$var)); //output:Array ( [0] => my n [1] => me is s [2] => dd [3] => m huss [4] => in s [5] => ifi )       echo crypt($varws);//output:-$1$m5/.1//.$KRawtTgnzzScShDJN3aHa.     echo crc32($var);//output:-1732983884  echo count_chars($var ,4);//output;-!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`bcgjklopqrtvwxz{|}~€ ‚ƒ„…†‡ˆ‰Š‹Œ Ž ’“”•–—˜™š›œ žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ    echo convert_uuencode($var);//output:-@;7D@;F%M92!I      echo convert_uudecode($var);// output:d4P L@M     echo convert_cyr_string($var,'m','a');       echo chunk_split($var,2,"(sam)");//output:-my(sam) n(sam)am(sam)e (sam)is(sam) s(sam)ad(sam)da(sam)m (sam)hu(sam)ss(sam)ai(sam)n (sam)s...

Notice: register_sidebar was called incorrectly. No id was set in the arguments array for the "Sidebar Top" sidebar.

Notice: register_sidebar was called incorrectly. No id was set in the arguments array for the "Sidebar Top" sidebar. add this code:-wp-include/config.php   change: define('WP_DEBUG', flase);  to below code here: // Enable WP_DEBUG mode define('WP_DEBUG', true); // Enable Debug logging to the /wp-content/debug.log file define('WP_DEBUG_LOG', true); // Disable display of errors and warnings  define('WP_DEBUG_DISPLAY', false); @ini_set('display_errors',0);