Tutorials
×
Python
Python
Django
Numpy
Pandas
Tkinter
Pytorch
Flask
OpenCV
AI, ML and Data Science
Artificial Intelligence
Machine Learning
Data Science
Deep Learning
TensorFlow
Artificial Neural Network
Matplotlib
Python Scipy
Java
Java
Servlet
JSP
Spring Boot
Spring Framework
Hibernate
JavaFX
Java Web Services
B.Tech and MCA
DBMS
Data Structures
Operating System
Computer Network
DAA
Computer Organization
Software Engineering
Data Mining
Web Technology
HTML
CSS
JavaScript
Jquery
Angular-8
React JS
React Native
Node JS
Software Testing
Software Testing
Selenium
JIRA
JMeter
Postman
TestNG
SoapUI
Cucumber
Interview
×
Technical Interview
C
C++
Php
Java
Python
JavaScript
TypeScript
Java Interview
JDBC
Servlet
Maven
Jenkins
Spring
Spring Boot
JDB
Hibernate
JSF
Web Interview
HTML
CSS
JavaScript
Jquery
Angular
Node-JS
AJAX
Database Interview
DBMS
SQL
PL/SQL
Oracle
MySQL
MongoDB
Redis
MariaDB
Company Interviews
IBM
Adobe
Microsoft
Amazon
TCS
HCL
Wipro
DXC
Accenture
Capgemini
Space X
Ericsson
Infosy
IGate
EXL
IndiaMART
Sapient
Compiler
Python
Java
Php
C
C++
R
Html
Javascript
Typescript
Swift
Home
Python
Java
JavaScript
HTML
SQL
PHP
C#
C++
DS
Aptitude
Reasoning
Selenium
DBMS
C
Andriod
Interview Q
PHP Tutorial
PHP Tutorial
Install PHP
PHP Code
PHP Echo
PHP Print
PHP Echo vs Print
PHP Variable
PHP Variable Scope
PHP $ and $$
PHP Constants
PHP Magic Constants
PHP Data Types
PHP Operators
PHP Comments
Control Statement
PHP If else
PHP Switch
PHP For Loop
PHP foreach loop
PHP While Loop
PHP Do While Loop
PHP Break
PHP Continue
PHP Programs
20 PHP Programs
Sum of Digits
Even Odd
Prime Number
Table of Number
Factorial
Armstrong Number
Palindrome Number
Fibonacci Series
Reverse Number
Reverse String
Swapping Two Numbers
Adding Two Numbers
Subtracting Two Numbers
Area of a Triangle
Area of Rectangle
Leap Year
Alphabet Triangle Method
Alphabet Triangle
Number Triangle
Star Triangle
PHP Functions
PHP Functions
Parameterized Function
PHP Call By Value
PHP Call By Reference
PHP Default Arguments
PHP Variable Arguments
PHP Recursive Function
PHP Arrays
PHP Array
PHP Indexed Array
PHP Associative Array
Multidimensional Array
PHP Array Functions
PHP Strings
PHP String
PHP String Functions
addcslashes()
addslashes()
bin2hex()
chop()
chr()
chunk_split()
convert_cyr_string()
convert_uudecode()
convert_uuencode()
count_chars()
crc32()
crypt()
echo()
explode()
fprint()
get_html_translation_table()
hebrev()
hebrevc()
hex2bin()
htmlentities()
html_entity_decode()
htmlspecialchars()
htmlspecialchars_decode()
Implode()
Join()
Levenshtein()
Lcfirst()
localeconv()
ltrim()
md5()
md5_files()
metaphone()
money_format()
nl2br()
nl_langinfo()
number_format()
ord()
parse_str()
print()
printf()
quoted_printable_decode()
quoted_printable_encode()
quotemeta()
rtrim()
setlocale()
sha1()
sha1_file()
similar_text()
Soundex()
sprintf()
sscanf()
strcasecmp()
strchr()
strcmp()
strcoll()
strcspn()
stripcslashes()
stripos()
stristr()
strlen()
strncasecmp()
strnatcasecmp()
strnatcmp()
strncmp()
strpbrk()
strripos()
strrpos()
strpos()
strrchr()
strrev()
strspn()
strstr()
strtok()
strtolower()
strtoupper()
strtr()
str_getcsv()
str_ireplace()
str_pad()
str_repeat()
str_replace()
str_rot13()
str_shuffle()
str_split()
strcoll()
strip_tags()
str_word_count()
substr()
substr_compare()
substr_count()
substr_replace()
trim()
ucfirst()
ucwords()
vfprintf()
vprintf()
vsprintf()
wordwrap()
PHP Math
PHP Math Functions
PHP Form
PHP Form: Get Post
PHP Include
PHP include & require
State Management
PHP Cookie
PHP Session
PHP File
PHP File Handling
PHP Open File
PHP Read File
PHP Write File
PHP Append File
PHP Delete File
Upload Download
PHP File Upload
PHP Download File
PHP Misc
require_once
include_once
MVC Architecture
PHP vs. JavaScript
PHP vs. HTML
PHP vs. Node.js
PHP vs Python
PhpStorm
PHP PDO
Top 10 PHP frameworks
phpMyAdmin
Count All Array Elements
Create Newline
Get Current Page URL
Remove First Element from Array
Remove Last Element from Array
Change Date Format
Get IP Address
PHP MySql Login System
var_dump() function
PHP Regular Expressions
preg_match() function
preg_replace() function
isset() function
print_r() function
Types of Errors in PHP
Display All Errors
PHP error_reporting
PHP header()
PHP unset() function
Get & Post Methods
Form Validation
Exception Handling in PHP
PHP try-catch
PHP Pagination
What is a Website
How to make a website
How to cite a website in APA format
How to cite a website in MLA format
How to download video from the website
PHP array_push
break vs continue in PHP
How to Install Composer on Windows
PHPMyAdmin Login
PHP alert
Creation of custom php.ini file in CPanel
Downgrade php 7.4 to 7.3 Ubuntu
Multiple File Upload using Dropzone JS in PHP
PHP Dropzone File Upload on Button Click
PHP find value in an array
PHP Codeigniter 3 Ajax Pagination using Jquery
How to Convert array into string in PHP
PHP Codeigniter 3 Create Dynamic Tree View using Bootstrap Treeview JS
CRUD Operation using PHP & Mongodb
PHP Ajax Multiple Image Upload
PHP Multidimensional Array Search By Value
PHP urlencode() Function
Image Gallery CRUD using PHP MySQL
How to get selected option value in PHP
Array to string conversion in PHP
PHP Contact Form
PHP string Concatenation
PHP Laravel 5.6 - Rest API with Passport
PHP compare dates
PHP Registration Form
PHP ternary operator
PHP basename() Function
Why do we need Interfaces in PHP
file_put_contents() Function in PHP
Is_array() Function in PHP
How to Use PHP Serialize() and Unserialize() Function
PHP Unset() vs Unlink() Function
PHP 5 vs PHP 7
PHP Imagearc() Function
PHP Imagecharup() Function
PHP Imagecolortransparent() Function
PHP Imagechar() Function
PHP Imagecreate() Function
PHP Imagecolorallocate() Function
PHP Image createtruecolor( ) Function
PHP Imagestring() Function
PHP Classes
Father of PHP
get vs post method in PHP
PHP append to array
fpassthru() Function in PHP
Imagick::borderImage() method in PHP
Imagick rotateImage() Function
Imagick transposeImage() Function
PHP Projects
Imagick floodFillPaintImage() Function
Imagick::charcoalImage() PHP
Imagick adaptiveBlurImage() Function
Imagick addImage() Function
Imagick addNoiseImage() Function
PHP Type Casting and Conversion of an Object to an Object of other class
PHP PEAR
PHP STR_CONTAINS()
Multiple Inheritance in PHP
What is a PHP Developer
PHP ob_start() Function
PHP Beautifier
PHP imagepolygon() Function
Free PHP Web Hosting
PHP Adminer
Polymorphism in PHP
PHP empty() Function
What is PHP-FPM
PHP STATIC VARIABLES
PHP IDE and Code Editor Software
PHP file_get_contents() Function
PHP sleep() Function
PHP server
PHP GMP Functions Detail Reference
PHP gmp_abs() Function
PHP gmp_add() Function
PHP gmp_and()Functions
PHP GMP gmp_clrbit() Function
PHP GMP gmp_cmp() Function
PHP GMP gmp_com() Function
PHP gmp_div_q() Function
PHP gmp_div_qr() Function
PHP gmp_or() function
PHP gmp_divexact() Function
PHP gmp_export() Function
PHP gmp_fact() Function
PHP gmp_gcd() Function
PHP gmp_import() Function
PHP gmp_intval() Function
PHP gmp_invert() Function
PHP gmp_jacobi() Function
PHP gmp_legendre() Function
PHP gmp_mod() Function
PHP gmp_prob_prime() function
PHP gmp_random_bits() function
PHP gmp_random_range() function
PHP gmp_root() function
PHP gmp_rootrem() function
PHP gmp_random_seed() function
PHP gmp_scan0() function
PHP gmp_scan1() function
PHP gmp_setbit() function
PHP GMP gmp_testbit() Function
PHP gmp_random() function
PHP gmp_xor() function
How to create html table with a while loop in PHP
How to Encrypt or Decrypt a String in PHP
PHP Mail
PHP Mail
PHP MySQLi
MySQLi CONNECT
MySQLi CREATE DB
MySQLi CREATE Table
MySQLi INSERT
MySQLi UPDATE
MySQLi DELETE
MySQLi SELECT
MySQLi Order by
PHP JSON
PHP JSON Example
PHP OOPs Concepts
OOPs Concepts
OOPs Abstract Class
OOPs Abstraction
OOPs Access Specifiers
OOPs Const Keyword
OOPs Constructor
OOPs Destructor
Abstract vs Class vs Interface
Encapsulation
Final Keyword
OOPs Functions
OOPs Inheritance
OOPs Interface
OOPs Overloading
OOPs Type Hinting
PHP Topics
Compound Types
PHP Float
PHP Integer
is_null() Function
PHP Boolean
Special Types
Inheritance Task
Special Types
PHP Encryption
Two-way Encryption
Heredoc Syntax
PHP MCQ
PHP MCQ
Related Tutorials
MySQL Tutorial
WordPress Tutorial
CodeIgniter Tutorial
YII Tutorial
Laravel Tutorial
Magento 2 Tutorial
Interview Questions
PHP Interview
WordPress Interview
Joomla Interview
Drupal Interview
PHP FTP
PHP FTP
ftp_close()
ftp_connect()
ftp_chdir()
ftp_chmod()
ftp_alloc()
ftp_cdup()
ftp_fget()
ftp_fput()
ftp_get_option()
ftp_get()
ftp_delete()
ftp_exec()
ftp_login()
ftp_mdtm()
ftp_mkdir()
ftp_mlsd()
ftp_nb_continue()
ftp_nb_fget()
ftp_rename()
ftp_rmdir()
next →
← prev
Interface
An
interface is similar to a class
except that it cannot contain code.
An interface can define
method names and arguments
, but not the contents of the methods.
Any classes implementing an interface must
implement all methods defined by the interface
.
A class can implement
multiple interfaces
.
An interface is declared using the "
interface
" keyword.
Interfaces
can't maintain Non-abstract methods.
Example 1
<?php interface a { public function dis1(); } interface b { public function dis2(); } class demo implements a,b { public function dis1() { echo "method 1..."; } public function dis2() { echo "method2..."; } } $obj= new demo(); $obj->dis1(); $obj->dis2(); ?>
Output:
Example 2
<?php interface i1 { public function fun1(); } interface i2 { public function fun2(); } class cls1 implements i1,i2 { function fun1() { echo "javatpoint"; } function fun2() { echo "SSSIT"; } } $obj= new cls1(); $obj->fun1(); $obj->fun2(); ?>
Output:
Next Topic
PHP OOPs Overloading
← prev
next →
Latest Courses