I am going to teach you PHP using Bootstrap and CodeIgniter framework practically. Before starting development it is necessary to know What is PHP, Bootstrap & CodeIgniter.
What is PHP?
PHP stands for “HyperText Preprocessor”. PHP is a server side scripting language, it is use to create dynamic webpages, It supports many CMS (Content Management System) like WordPress, osCommerce etc.
What is Bootstrap?
Bootstrap is a combination of HTML, CSS and JavaScript we can also call it is a framework of HTML, CSS & JavaScript for developing responsive, mobile-first websites, here responsive means webpages adjust according to the width of the device like laptop, mobile, tablet.
What is CodeIgniter?
CodeIgniter is a PHP framework, It is an Open Source Framework, It has a very rich set of Libraries and Helpers which make our website development easier not only that codeIgniter is also very secure it has the ability to prevent various attacks on our websites.
Some features of CodeIgniter:
- It follows MVC (Model View Controller)
- Light Weight
- Form and Data Validation
- Session Management
- It has Email Sending Class It supports attachments, HTML Email, Multiple Protocols
- Image Manipulation Library (Cropping, Resizing, Rotating etc.)
- File Uploading Class.
- FTP Class.
- Localization.
- Pagination and many more.
Now you understand what is PHP, What is Bootstrap & What is CodeIgniter I am starting this series of Tutorial to teach you PHP practically so here I am not going to teach you the basic programming fundamentals like control statements, functions, arrays, strings etc. I am assuming that you know these things. So without wasting time jump on practical use of PHP.
First of all we are going to create a Hello World example in PHP.
The PHP file must be save with .php extension. Let’s see a simple PHP example
File: hello.php
<!DOCTYPE>
<html>
<body>
<?php
echo "<h2>Hello World</h2>";
?>
</body>
</html>
Output:
Hello World
File: hello.php
<!DOCTYPE>
<html>
<body>
<?php
echo "<h2>Hello World</h2>";
?>
</body>
</html>
Output:
Hello World
In the above example you see <?php some statements ?>
- we have to write the php code inside this <?php statements ?>
- echo is used to display some values on the web page.
Bootstrap Example:
Bootstrap divides the width of the screen in 12 columns below is the example of bootstrap and show how width divides the screen in 12 columns.
Example:
<div class="container">
<div class="row">
<div class="col-sm-4 col-lg-4 col-md-4">
<h3>Column 1</h3>
<p>I am Column 1</p>
</div>
<div class="col-sm-4 col-lg-4 col-md-4">
<h3>Column 2</h3>
<p>I am Column 2</p>
</div>
<div class="col-sm-4 col-lg-4 col-md-4">
<h3>Column 3</h3>
<p>I am Column 3</p>
</div>
</div>
</div>
Note: Here I am dividing the width of the screen in 3 columns and col-sm-4 means on small device 4 column merge in 1 column, col-md-4 means on medium device 4 column merge in 1 column, col-lg-4 means on large device 4 column merge in 1 column. You will understand correctly by below image.
If you like this tutorial series then subscribe us to get the upcoming tutorials direct in your Inbox.
0 Comments