• Skip to main content
  • Skip to primary sidebar
  • Home
  • WordPress
  • web Hosting
  • linux
  • mysql
  • nginx
  • apache2
  • devops

Raju Ginni

wordpress tutorials seo hosting etc

You are here: Home / tutorials / Php tutorials

Php tutorials

Table of Contents

Toggle
  • Default Syntax
  • Variables in PHP
  • Constants in PHP
  • Control Structures
  • Functions
  • Arrays
  • Regular Expressions
  • Object-Oriented Programming in PHP
  • PHP with MySQL
  • Strings and Regular Expressions
  • Working with the Files and Operating System
  • Error and Exception Handling
  • Authentication
    • Cookies & sessions
    • Web Services
  • XML Integration
  • MySQL Concepts
  • Mysqli_query 

Default Syntax

  • Styles of PHP Tags
  • Comments in PHP
  • Output functions in PHP
  • Datatypes in PHP
  • Configuration Settings
  • Error Types

Variables in PHP

  • Variable Declarations
  • Variable Scope
  • PHP’s Superglobal Variables
  • Variable Variables

Constants in PHP

  • Magic Constants
  • Standard Pre-defined Constants
  • Core Pre-defined Languages
  • User-defined Constants

Control Structures

  • Execution Control Statements
  • Conditional Statements
  • Looping Statements with Real-time Examples

Functions

  • Creating Functions
  • Passing Arguments by Value and Reference
  • Recursive Functions

Arrays

Regular Expressions

  • Validating text boxes,emails,phone number,etc
  • Creating custom regular expressions

Object-Oriented Programming in PHP

  • Classes, Objects, Fields, Properties, _set(), Constants, Methods
  • Encapsulation
  • Inheritance and types
  • Polymorphism
  • Constructor and Destructor
  • Static Class Members, Instance of Keyword, Helper Functions
  • Object Cloning and Copy
  • Reflections

PHP with MySQL

  • Integration with MySQL
  • MySQL functions
  • Gmail Data Grid options
  • SQL Injection
  • Uploading and downloading images in Database
  • Registration and Login forms with validations

Strings and Regular Expressions

  • Declarations styles of String Variables
  • Heredoc style
  • String Functions
  • Regular Expression Stntax(POSIX)
  • PHP’s Regular Expression Functions(POSIX Extended)

Working with the Files and Operating System

  • File Functions
  • Open, Create and Delete files
  • Create Directories and Manipulate them
  • Information about Hard Disk
  • Directory Functions
  • Calculating File, Directory and Disk Sizes

Error and Exception Handling

  • Error Logging
  • Configuration Directives
  • PHP’s Exception Class
  • Throw New Exception
  • Custom Exceptions


Authentication

  • HTTP Authentication
  • PHP Authentication
  • Authentication Methodologies

Cookies & sessions

  • Types of Cookies
  • How to Create and Access Cookies
  • Session Variables
  • Creating and Destroying a Session
  • Retrieving and Setting the Session ID
  • Encoding and Decoding Session Data
  • Auto-Login
  • Recently Viewed Document Index

Web Services

  • RSS Syntax
  • SOAP
  • How to Access Web Services

XML Integration

  • Create a XML file from PHP with Database records
  • Reading Information from XML File

MySQL Concepts

  • Storage Engines
  • Functions
  • Operators
  • Constraints
  • DDL commands
  • DML Commands
  • DCL Command
  • TCL Commands
  • Views
  • Joins
  • Cursors
  • Indexing
  • Stored Procedures
  • Mysql with PHP Programming
  • Mysql with Sqlserver(Optional)

 

PHP Global variables:

Get & Post methods:

data can be sent to Body no one can see the data. (secure and mostly used).

 

$_POST[]: both post and get variables extracts the form fields into variables and values

$_GET[]:   used send data via URL or http header. (security issues anyone can see the data)

$_REQUEST[]: it accepts both get and post method in form fields.

<form method=”POST” action=”action.php” name=return false validate()/>

Name: input type=”text” name=”name”/>

email: input type=”text” name=”email”/>

Mobile: Input type=”text” name=”mobile” />

Password: input tyepe=”text” name=”password”/>

<input type=”submit” value=”display text” />

</form>

in the above Name values (name,email,mobile,passwords)  treats as Variables. and user entered inputs are treats as values.

this can be extracted by extract(S_Post[form])

Onclick form we hae set return false to validate details by cilentside scripts like js,jquery etc

 

server-side validation:

 

isset(): to know it contains value or not

empty() to check variable null or not.

 

Query strings:  also known as “?”, using this we can pass keys and values via URL.  using get method.

 

 

 

 

Connecting database 

 

$dbconnection= Mysqli_connect(“localhost or remote”,”dbuser”,”password or empty”, “databasename”)

// Checking connection
if (!dbconnection) {
die(“Notconnect ” . mysqli_connect_error());  //here conactinating stings with mysql error fucntion to display errors.
}

 

mysqli_select_db(“databasename”)

  • Warning: mysqli_select_db() expects exactly 2 parameters, 1 given

Error mysqli_select_db() should have 2 parameters, the connection link and the database name –

mysqli_select_db($dbconnection, ‘databaename‘) or die(mysqli_error($con));

Mysqli_query 

  • error :Warning: mysqli_query() expects at least 2 parameters, 1 given

$query = mysqli_query($dbconnection, “SQL query“);

 

 

Mysqli vs MySQL_connect”

 

mysqli is improved version of MySQL available from PHP 7. MySQL extension works up to PHP 5.6.

 

INSET query:

“Inset into table name (column1, column2, column3,) values (val1, val2, val3)”;

 

Arrays:

Associative array:  in the form keys and value

ex: $form = array(“name”=>”alebert”, “email”=>”g@gmail.com”, “mobile”=>”000000000”);

Index array:  $values = array(“1”, “2”, “3”);

$values[0] = “1”;
$values[1] = “2”;
$values[2] = “3”;

Multidimensional array: 

 

 

WordPress & Php 7 compatibility and issues

Please Upgrade php5.6 to PHP 7.1 which uses less ram and faster performance.

RAM consume different 40MB with PHP 5.6 and php7.xx using 4-10GB ram hard. all themes and WordPress core also compatible with PHP 7 upgrade and save resources billing. also, give better speed for the user.

 

diffrence among =, ===, and ===.

x = 1 //x now equals 1
true == 1 //does the boolean value of true equal 1? (True) //not strict
true === 1 //does the boolean value of true equal 1? (False) //strict

 

Object Oriented PHP

 

Reader Interactions

Ask a Question:

You must be logged in to post a comment.

Primary Sidebar

tutorials

  • Core Java Tutorial Free online
  • HTML & CSS Tutorials
  • Php tutorials
    • OPcache enable / configuration settings purge wordpress nginx php-fpm ubuntu (How to enable)
    • PHP performance tuning nginx php-fpm conf pool manger dynamic vs static vs on demand
    • how to write html in php
  • ubuntu tutorials installation download issues etc
  • redis install ubuntu 20.04 with wordpress php redis mysql configuration
  • [INTRO] Ethical hacking / cyber Security / Penetration testing Tutorial -{updates frequently}
  • Android Studio tutorials syllabus Topics Course details #AndroidApplicationDevelopment
  • AUdio Editing Background Noise removal (Audacity, Adobe Premiere Addition, Camtasia Filmora Windows Obs)
  • what is vpn vs proxy vs tor, http vs https, http2, tcp vs udp, kali linux sql source code injection
  • how to create a website free of cost on google
  • CCNA Syllabus pdf (CCNA / CCNP vs devops vs mcsa /MCSE)
  • Redis performance metrics & tuning for nginx apache ubuntu & debian
  • xampp tutorials 2021 installation errors fix wordpress phpmyadmin mysql apache
  • new relic installation linux (infrastructure agent , php, mysql , nginx)
  • new relic mysql install integration - 2 ways fix problems
  • new relic php agent install in 3 steps
  • aws load balancer tutorial
  • git branches merge fetch pull conflicts

hi i am raju ginni, primalry i manage wordpress websites on GCP cloud platform as a cloud engineer, and create content on passionate things.
you can follow me on youtbe

© 2025 - All Rights Reserved Disclaimer & Privacy Policy