New Features in PHP 5.4

This subject New Features in PHP 5.4 is not new as PHP 5.4 was released on March 1, 2012, But many of us still do not know what are the New features in php 5.4, So lets get familiar with them .

Why should I upgrade to 5.4 ? So What’s new Features in PHP 5.4 ?

So before going any further i will give you a very obvious reason of them all which is performance and security ūüôā

Continue reading

Tutorial to Write PHP Code in HTML files

Write PHP Code in HTML files

If you have ever come across the scenario in which you have to automate a website in which all the file are having an extension of .html and you have to write PHP code in Html files and you have to change all the file name extensions from .html to .php , After doing this you have to change all the Internal Links of the website too.

The solutions works fine but takes ample amount of time . In some cases it may take hours to do so.

What if I say it can be done in about 20 to 30 seconds and with very less amount of code. COOL RIGHT !!
This is what we are going to do here today and will run PHP Code in Html file or any other desired extension!

So this miracle can be done in two ways .

  1.  The first can be done by working on Configuration of Your Server. (The hard and Delicate one).
  2.  The Second can be done by using .htaccess file. (The easy and Cool one).

Continue reading

What are TRAITS in PHP ?

What are Trait in PHP ? Why do we need Trait in PHP ?

In this article we will be working on a very new feature which is introduced in PHP 5.4 which is Traits in PHP.
Traits are mechanisms which help and increase in code re-usability, and also serves perfectly to solve the problem of multiple inheritance in php.

For example we have two or more than two classes that need to access a method / function .
So to solve this before version 5.4 you were suppose to do something like :

Continue reading

CURL in PHP Tutorial basics

I have been asked this question multiple times from my colleagues and my fellow-mates . What is curl? How to use curl ? and When to use Curl ? So in the following blog I am going to answer all your questions .

In PHP if you want to access outside URL from your website there are four ways to do so
Using the  fopen() function
Using the  fsockopen() function
Using the  cURL library
Using the  Http_Request class

All these function have their own specific use but cURL is the most recommended one.
In order to run cURL in your website or in php you need to install and enable it . If it is already installed you can skip to part for basic use of curl .

Continue reading

How to speed up your site & conversions

Having a fast web site is a dream, and is very essential for good user experience and also is a  major factors of SEO and Google ranking. A website that does not Slows Down while opening  is much more friendly at first site for the visitor and works until  conversion takes place. For instance  Amazon as all of us know is  one of the biggest on-line stores in the world, did a tests and came to the conclusion which was that a single second delay on page load cost a loss of $ 1.6 billion which lead to  drop in conversion rate .

It is important to keep an eye on this . If your site takes a lot of time  to load, or is difficult  to open quickly you may be missing good visits and  conversions.

Continue reading

What is Version Control ?

This Post will answer all your question about what a version control is and why do we use a version control  and what are its features .

Version Control Explanation

It is very common these day that many developer want to have full control over their generated code while development . Some time we work on small chunk of code and some time its a very big feature, we always don’t remember what was the function of the code we did . We might have written the code while we were half asleep, in early morning or Drunk … Who can tell !!

Continue reading

Introduction to Arrays in PHP

In the following article ( introduction to arrays in php ) we will talk about arrays in php, Syntax, Types and how to use them. Before we begin “What exactly is an Array ?”

Array is a collection of values which are stored in a single variable. By now you might have seen that you can store characters and numeric values in a variable. But by the use of array, you can store various types of values in a single variable. Lets see the example below: Continue reading

An Introduction to JSON format

This article is based on basics of JSON, a model for the representation of information widely used by Web applications that work with AJAX technology and many more.

 1. Introduction to JSON

JSON (JavaScript Object Notation) is a model for storage and transmission of information in text format. Although very simple, it has been widely used by Web applications due to its ability to structure information in a form much more compact than that achieved by the XML model, making it faster parsing such information. This explains the fact that the JSON have been adopted by companies such as Google and Yahoo, whose applications need to transmit large volumes of data.

This article provides an introduction to JSON format and is divided as follows. Section 2 describes the syntax of the language. Then, the section 3 performs a comparison between XML and JSON models.  Continue reading