Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Learn PHP in 24 Hours
Learn PHP in 24 Hours
Learn PHP in 24 Hours
Ebook356 pages2 hours

Learn PHP in 24 Hours

Rating: 0 out of 5 stars

()

Read preview

About this ebook

PHP is a versatile language based on object-oriented programming concept. It is practiced by a huge community. PHP is the least complex and makes better applications if used in the right context. It supports some great frameworks like Zend, Laravel, and Symphony.


Most beginners find PHP difficult because they either spend a long time learning all the things, or they are using poorly crafted online courses. To make PHP easier to learn, we extracted some niche topic of PHP and compiled them in simple to understand format in this small e-book. On top of it, the examples are made more interactive to help understand some advanced PHP topics. The best part of this e-book is the price is almost negligible.


With this edition, beginners will learn to interpret PHP language in the nick of time. They will able to build a basic application on HTML, CSS, etc. without any peer guidance or external course. All the major concept of PHP are covered in this e-book. Once you know the tips and tricks, the book can be a guide for building Web-based services for mobile devices. You will be able to gain more knowledge about PHP functions and MySQL through it.


Besides having limited coding language, you will become someone having a deeper understanding of PHP in no time. With this e-book, you soon can become the part of these huge base of PHP users like Facebook, Yahoo, Wikipedia, Wordpress, and so on.


Table of Contents


Chapter 1: Introduction


What is a scripting language?


Scripting VS Programming Language


What does PHP stand for?


Php Syntax


What is PHP used for & Market share


PHP vs ASP.NET VS JSP VS CFML


Chapter 2: Introduction to XAMPP


What is XAMPP?


How to Download and Install XAMPP


XAMPP Control Panel


What is the best PHP IDE?


Introduction to Netbeans IDE


Creating a new PHP project using the Netbeans IDE


Chapter 3: Data Types, Variables and Operators


Data Types


Variable


Variable Type Casting


Constant


Operators


Chapter 4: Comments, Include & Require


Comments


Include & PHP Include_once


Require & PHP require_once


include vs require


Chapter 5: Arrays


What is an Array?


Numeric Arrays


Associative Array


Multi-dimensional arrays


Arrays: Operators


Chapter 6: Control structures


What is a control structure?


IF Else


PHP Loop


While Loop


Switch Case


Chapter 7: Strings


What is a string?


Create Strings Using Double quotes


Heredoc


Nowdoc


String functions


Chapter 8: Functions


What is a Function?


Built in Functions


String Functions


Numeric Functions


Date Function


Why use User Defined Functions?


Chapter 9: Forms


What is form?


Create a form


POST method


GET method


GET vs POST Methods


Processing the registration form data


Chapter 10: Cookies & Sessions


Chapter 11: File Processing


Chapter 12: Error Handling


Chapter 13: Regular Expression


Chapter 14: MAIL


Chapter 15: Database Access


Chapter 16: OOPS


LanguageEnglish
PublisherPublishdrive
Release dateOct 31, 2021
Learn PHP in 24 Hours

Read more from Alex Nordeen

Related to Learn PHP in 24 Hours

Related ebooks

Programming For You

View More

Related articles

Reviews for Learn PHP in 24 Hours

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Learn PHP in 24 Hours - Alex Nordeen

    Learn PHP in 24 Hours

    By Alex Nordeen

    Copyright 2021 - All Rights Reserved – Alex Nordeen

    ALL RIGHTS RESERVED. No part of this publication may be reproduced or transmitted in any form whatsoever, electronic, or mechanical, including photocopying, recording, or by any informational storage or retrieval system without express written, dated and signed permission from the author.

    Table of Contents

    Chapter 1: Introduction

    What is a scripting language?

    Scripting VS Programming Language

    What does PHP stand for?

    Php Syntax

    What is PHP used for & Market share

    PHP vs ASP.NET VS JSP VS CFML

    Chapter 2: Introduction to XAMPP

    What is XAMPP?

    How to Download and Install XAMPP

    XAMPP Control Panel

    What is the best PHP IDE?

    Introduction to Netbeans IDE

    Creating a new PHP project using the Netbeans IDE

    Chapter 3: Data Types, Variables and Operators

    Data Types

    Variable

    Variable Type Casting

    Constant

    Operators

    Chapter 4: Comments, Include & Require

    Comments

    Include & PHP Include_once

    Require & PHP require_once

    include vs require

    Chapter 5: Arrays

    What is an Array?

    Numeric Arrays

    Associative Array

    Multi-dimensional arrays

    Arrays: Operators

    Chapter 6: Control structures

    What is a control structure?

    IF Else

    PHP Loop

    While Loop

    Switch Case

    Chapter 7: Strings

    What is a string?

    Create Strings Using Double quotes

    Heredoc

    Nowdoc

    String functions

    Chapter 8: Functions

    What is a Function?

    Built in Functions

    String Functions

    Numeric Functions

    Date Function

    Why use User Defined Functions?

    Chapter 9: Forms

    What is form?

    Create a form

    POST method

    GET method

    GET vs POST Methods

    Processing the registration form data

    Chapter 10: Cookies & Sessions

    What is Cookies?

    Creating Cookies

    Retrieving the Cookie value

    What is a Session?

    Creating a Session

    Chapter 11: File Processing

    What is a File?

    File_exists Function

    Fopen Function

    Fwrite Function

    Fgets Function

    File_get_contents Function

    Chapter 12: Error Handling

    What is an Exception?

    PHP Error handling

    Error handling examples

    Difference between Errors and Exception

    Multiple Exceptions

    Chapter 13: Regular Expression

    What is a regular expressions?

    Preg_match

    Preg_split

    Preg_replace

    Meta characters

    Explaining the pattern

    Chapter 14: MAIL

    What is PHP mail?

    Why/When to use the PHP mail

    Simple Transmission Protocol

    Sanitizing email user inputs

    Secure Mail

    Chapter 15: Database Access

    mysql_connect function

    mysql_select_db function

    mysql_query function

    mysql_num_rows function

    mysql_fetch_array function

    Data Access Object PDO

    Chapter 16: OOPS

    What is UML?

    What is object oriented programming?

    Creating a class

    Inheritance implementation

    Using the classes

    Testing our application

    Chapter 17: Date

    What is Date Function?

    What is a TimeStamp?

    PHP set Timezone Programmatically

    Mktime Function

    PHP Date function reference

    Chapter 18: Security Functions

    What is a Security?

    Potential security threats

    PHP Application Security Best Practices

    filter_var function

    PHP Md5 and PHP sha1

    Chapter 19: XML,DOM, Parsers

    What is XML?

    What is DOM?

    XML Parsers

    Creating the index page that reads the XML document

    Creating an XML document using PHP

    Chapter 20: Sample Project

    Opinion Polls

    Database

    Coding our application

    Testing our application

    Chapter 21: PHP with Ajax

    What is JavaScript?

    What is XML?

    What is Ajax?

    Creating an Ajax application

    Chapter 22: Frameworks

    What is a framework?

    Introduction to PHP MVC framework

    Porting the opinion poll application to CodeIgniter

    Database configuration settings

    Creating Our Model

    Creating Our Views

    Chapter 1: Introduction

    What is a scripting language?

    A script is a set of programming instructions that is interpreted at runtime.

    A scripting language is a language that interprets scripts at runtime. Scripts are usually embedded into other software environments.

    The purpose of the scripts is usually to enhance the performance or perform routine tasks for an application.

    Server side scripts are interpreted on the server while client side scripts are interpreted by the client application.

    PHP is a server side script that is interpreted on the server while JavaScript is an example of a client side script that is interpreted by the client browser.

    Both PHP and JavaScript can be embedded into HTML pages.

    Scripting VS Programming Language

    What does PHP stand for?

    PHP means - Personal Home Page, but it now stands for the recursive backronym PHP: Hypertext Preprocessor.

    PHP code may be embedded into HTML code, or it can be used in combination with various web template systems, web content management system and web frameworks.

    Define PHP or What is PHP?

    The acronym PHP initially stood for Personal Home Pages.

    As of version 3, it stands for PHP Hypertext pre-processor. It is a general purpose server side scripting language that is used to develop;

    Static websites

    Dynamic websites

    Web applications

    PHP scripts can only be interpreted on a server that has PHP installed.

    The client computers accessing the PHP scripts require a web browser only.

    A PHP file contains PHP tags and ends with the extension .php.

    The diagram below shows how a PHP programming file looks like.

    Php Syntax

        echo 'Hello World';

    ?>

    A PHP file can also contain tags such as HTML and client side scripts such as JavaScript.

    HTMLis an added advantage when learning PHP Language. You can even learn PHP without knowing HTML but it’s recommended you at least know the basics of HTML.

    Database management systems DBMS for database powered applications.

    For more advanced topics such as interactive applications and web services, you will need JavaScript and XML.

    Why use PHP?

    You have obviously head of a number of programming languages out there; you may be wondering why we would want to use PHP as our poison for the web programming. Below are some of the compelling reasons.

    PHP is open source and free.

    Short learning curve compared to other languages such as JSP, ASP etc.

    Large community document

    Most web hosting servers support PHP by default unlike other languages such as ASP that need IIS. This makes PHP a cost effective choice.

    PHP is regular updated to keep abreast with the latest technology trends.

    Other benefit that you get with PHP is that it’s a server side scripting language; this means you only need to install it on the server and client computers requesting for resources from the server do not need to have PHP installed; only a web browser would be enough.

    PHP has in built support for working hand in hand with MySQL; this doesn’t mean you can’t use PHP with other database management systems. You can still use PHP with

    Postgres

    Oracle

    MS SQL Server

    ODBC etc.

    PHP is cross platform; this means you can deploy your application on a number of different operating systems such as windows, Linux, Mac OS etc.

    What is PHP used for & Market share

    In terms of market share, there are over 20 million websites and application on the internet developed using PHP scripting language.

    This may be attributed to the points raised above;

    PHP vs ASP.NET VS JSP VS CFML

    ASP – Active Server Pages JSP – Java Server Pages CFML – Cold Fusion Markup language The table below compares the various server side scripting languages with PHP

    PHP File Extensions

    File extension and Tags In order for the server to identify our PHP files and scripts, we must save the file with the .php extension. Older PHP file extensions include

    .phtml

    .php3

    .php4

    .php5

    .phps

    PHP was designed to work with HTML, and as such, it can be embedded into the HTML code.

    You can create PHP files without any html tags and that is called Pure PHP file .

    The server interprets the PHP code and outputs the results as HTML code to the web browsers.

    In order for the server to identify the PHP code from the HTML code, we must always enclose the PHP code in PHP tags.

    A PHP tag starts with the less than symbol followed by the question mark and then the words php.

    PHP is a case sensitive language, VAR is not the same as var.

    The PHP tags themselves are not case-sensitive, but it is strongly recommended that we use lower case letter. The code below   illustrates the

    Enjoying the preview?
    Page 1 of 1