Java Techies- Solution for All
PHP
1.1 Introduction
PHP is server-side technology, which means it doesn't run on the
client, which is what a Web browser is. Learn More... |
1.2 Data Type
PHP is loosely typed, which means it calculates data types as data
is assigned to each variable.
Learn More... |
1.3 Constant
Constants have global scope, so they are accessible.
Learn More... |
1.4 Output
The simplest use of echo is to print a string as argument.
Learn More... |
1.5 Variables
Variable is Special type of container which can hold the value . Learn More... |
1.6 Looping
Number of times-when you can tell by looking at the code how many
times the loop will iterate. Learn More... |
1.6.1 While
The while loop checks the condition expression as a Boolean—if
it is true, it executes statement and then starts again by
evaluating condition.
Learn More... |
1.6.2 Do-while
The statement is executed once, and then the expression is
evaluated. If the expression is true, the statement is repeated
until the expression becomes false.
Learn More... |
1.6.3 For
For statement, first the initial-expression is evaluated for
once, to initialize variables then termination-check is
evaluated,if it is false, the for statement ends, and if it is
true, the statement executes.
Learn More... |
1.6.4 For each Loop
The foreach loop is used to loop through arrays.
Learn More... |
1.6.5 Break and Continue
Break is used in terminating the loop immediately after it is
encountered.The break statement is used with conditional if
statement.
Learn More... |
1.8 Branching
Two main structures for branching are if and switch. Learn More... |
1.8.1 If-Else
When an if statement is processed, the condition expression is
evaluated, and the result is interpreted as a Boolean value.
Learn More... |
1.8.2 Switch
Switch is a useful alternative for certain situations where you
want multiple possible branches based on a single value and where
a series of if statements would be cumbersome.
Learn More... |
1.9 Function
A function is a way of wrapping up a some part of code(Chunk) and
giving that small name(Chunk), so that you can use chunk that
later in just one line of code. Learn More... |
1.10 Array
Arrays store element values in association with key values rather
than index order. Learn More... |
1.10.1 Creating an Arrays
Three main ways to create an array in a PHP script that happens
to return an array as its value :
- By assigning a value into one. - By using the array() construct. - By calling a function. Learn More... |
1.10.2 Some Sort Functions For Arrayssort()
:This Function sort arrays in ascending order. rsort()
: This Function sort arrays in descending order. Learn More... |
1.11 String
Strings are sequences of characters. It can be treated as a string
assigned to variables, given as input to functions, returned from
functions, or sent as output to your user's Web page. Learn More... |
1.11.1 String Concatenation Operator
When operator placed between two string arguments,produces a new
string that is the result of putting the two strings together in
sequence.
Learn More... |
1.11.2 String Functions
There are different types of String Functions :-
strlen()
: use to find out length of string or string length.strlen()
: use to replace all instances of a particular substring with an
alternate string. Learn More... |
1.12 Forms
PHP is very efficient at passing data because the developers made
a it very easy when they choose suitable design decision. Learn More... |
1.11.1 GET Method
The
GET method
is use to pass arguments from one page to another of next page as
part of the Uniform Resource Indicator(URI).Learn More... |
1.11.2 POST Method
The
POST method
is used for form submission today, particularly in non idempotent
usages, such as adding information to a database.Learn More... |
1.13 OOP's
PHP is not an object-oriented language because OOP wasn't added
until PHP 3. When PHP 5 was released in July 2004,the path of
classes and objects work in PHP was changed originally. Learn More... |
1.13.1 Class
A
class
is simply a representation of a type of object.It is the
blueprint/ plan/ template that describe the details of an object.Learn More... |
1.13.2 Object
An Object is a real world entity. An object can be considered a
"thing" that can perform a set of related activities.
Learn More... |
1.13.3 Access Modifier
In Private access modifier,properties and methods can be accessed
only within the class.
Learn More... |
1.13.4 Encapsulation
Encapsulation is to ascertain that each part of an application is
seperate and doesn't interfere with any others. When defining a
property in a class, you must specify whether it's public,
private, or protected.
Learn More... |
1.13.5 Constructor and Destructor
PHP 5 provides two ways where you can write a constructor method
inside a class. First way is to create a method with the name
__construct() inside the class.
Learn More... |
1.13.6 Inheritance
Inheritance is feature in OOP where you can extend a class and
create a completely new object. The new object keep all the
functionality of the parent object from which it is extended or
can override.
Learn More... |
1.13.7 Polymorphism
Polymorphism is the process of creating several objects from
specific base classes.
Learn More... |
1.13.8 Abstract Class
An abstract class is same as interface,except that now the
methods can contain body. An abstract class must also be
"extended".
Learn More... |
1.13.9 Interface
Interface contains only the declaration of methods. If any class
which implement this interface must contain the declared
functions in it.
Learn More... |
1.13.10 Static Keyword
A static keyword is very important concept in OOP. Static method
and properties play important role in Development.
Learn More... |
1.13.11 Final Keyword
If you declare method as
final
in super class it can't be overridden in any of its subclass. Learn More... |
1.14 Exception Handling
PHP 5 introduces an exceptions objects to simplify your error . An
Exception is any unusual condition that causes an alteration in
program flow, such as a missing file or a null pointer. Learn More... |
1.15 Date() |
1.16 include |
1.17 Filefopen()
: This function is used to open the files in PHP.fclose()
:This function is used to close an open file.Learn More... |
1.18 File Upload
PHP provides simple way to upload files to server.
enctype="multipart/form-data"
creates both a binary and an ascii upload. Learn More... |
1.19 Cookies
Cookies are small text files that are used by a Web server to keep
track of users.
A cookie has value in the form of name-value pairs. Learn More... |
1.20 Session
Sessions variable are used to identify a user which store on your
server.
A new session is created if one does not already exist. Learn More... |
1.21 Filter
Filter use when the data source contains user input data or
unknown data.
Validation is used to validate or restrict some user input. Learn More... |
1.22MySql
MySQL is the most popular Open Source SQL database management
system.
MySQL is developed and supported by Oracle Corporation. Learn More... |
1.22.1 MySQl Connect with PHPmysql_connect
and
mysqli_connect()
function are use to open a new connection to the MySQL server in
PHP. Learn More... |
1.22.2 Create Database |
1.22.3 Create Table |
1.22.4 Insert In TO |
1.22.5 SELECT |
1.22.6 WHERE |
1.22.7 ORDER BY |
1.22.8 UPDATE |
1.22.9 DELETE |
1.23 Registration Page
In this example,we create one simple Registration Page in html and
connect code with MySQL database and php script. Learn More... |
1.24 Login Page
PHP is very efficient at passing data because the developers made
a it very easy when they choose suitable design decision. Learn More... |
1.25 PHP CAPTCHA |
1.26 Password Encryptionmd5()
function use to calculate the md5 hash of a given file. The hash
is a 32-character hexadecimal number. Learn More... |
1.27 Examples
Here are some applications example of PHP. Learn More... |