What is apt-get
apt-get is a powerful command-line tool used for package management in Debian Linux distribution. It used to work with Ubuntu’s APT (Advanced Packaging Tool) library to Install/manage individual packages , Remove installed package, Upgrade packages etc.
To install package through apt-get package manager For installing package, just write apt-get install and mention the name of package.
apt-get install package-name
For example- If i need to install phpmyadmin
apt-get install phpmyadmin
NOTE: if you get permission denied error, then use sudo with this command. To install any package or software in Ubuntu you need root access.
sudo apt-get install phpmyadmin
once you type and enter, it ask password for root user
As of PHP 5.4.0, PHP implements a method of code reuse called Traits.
PHP 5.4 introduces the concept of traits. Until Traits PHP uses Classical inheritance model in which one class can inherit only one class. In simple words Before PHP 5.4 PHP uses single inheritance model , which makes sometimes difficult to reuse the code.
Traits allow developer to reuse sets of methods freely in several independent classes living in different class hierarchies.
CSV stands for Comma Separated Values. This file format is commonly used to store data, export data from database etc.
Let’s create a CSV with more values. Now we are creating CSV with following header and multiple records.
How to create lazy loading images using jQuery
The Lazy plugin for jQuery load specified images after the page load itself and speed up your loading time,
useful jQuery plugin which can load images on page scroll called lazy loading, if you used high resolution images on your website then it’s a best solution for you to make your web site looks professional. This makes the page load faster and reduce server traffic since the client loads the images in the region what they look at.
How to Increase PHP Memory Limit
When you saw an error like “Fatal Error: Allowed memory size of xxxxxx bytes exhausted” either in browser or server logs, it means PHP had exhausted the max memory limit. Mostly, this is due to the insufficient memory allocated for PHP script. And in this article, we will talk about how to increase the memory limit of PHP.
Check PHP memory_limit To see how much memory allocated for you php, you need to create a file on your server (like view_php_info.php), and put following code in it:
<?php phpinfo();?>
Visit it in your browser, you’ll see a table which lists out all the config about current php environment. Search for “memory_limit”, you’ll see:
Extract website data using php
Web Crawling. The process by which we extract images, hyperlinks, metadata and several other things from a website is called web crawling. So in this tutorial you will learn about how to crawl images and hyperlinks from a website using php.And also I have used here jquery ajax for displaying the results without page refreshing, and its not mandatory.