The Best Practice for Handling Date Time in PHP

Author : admin

Date time is very extremely important if we will build critical application, so we must special attention for it. Handling date time properly in our program is more complicated than handling strings or numbers variable. Because date time is not a single value but a collection of values, such day, month, year, hour, minute and second. In this discussion, we will share the best practical, how we handling date time in our application.

In the programming convention, date time calculation is to treat a particular time and date as a single value, the number of seconds that have elapsed since midnight on January 1, 1970. It’s called an epoch timestamp. … continue reading : The Best Practice for Handling Date Time in PHP.

15 November 2009 at 12:03 - Comments

The Secret of PHP Variables

Author : admin

If we are familiar with programming, we are certainly familiar with variables, how to declare and use it. In this discussion, we will discuss more about the variables, with specific scope of PHP as programming language and what is the secret behind the PHP variables.

Variables are containers used to hold information and it can be used later in our script. A variables has a name and information is stored in the variable. So, how to we will declare and create it ..? … continue reading : The Secret of PHP Variables.

15 November 2009 at 00:14 - Comments

Basic Learning PHP Function

Author : admin

PHP as programming language and server side scripting was originally using procedural programming, it’s not an object oriented language. In procedural programming, real power of PHP comes from functions ( in the PHP there are more than 700 built functions ). See detail the built in functions in the PHP, please visit PHP Site Reference.

A function in the PHP is a block of code that can be defined once and reused in multiple part of the program. Functions often take multiple parameters that allow we to pass data in and out of our functions. In some cases, a function doesn’t have to take any parameters at all. … continue reading : Basic Learning PHP Function.

2 November 2009 at 23:45 - Comments

Basic Learning PHP : Looping

Author : admin

In PHP programming, we are often required to repeat a block of code, instead of adding several almost equal lines in a script we can use loops to perform a task like this. PHP has three types of loop constructs that all do the same thing, repeat a block of code a number of times, FOR loop, DO loop and WHILE loop. There are other types that have specific function in array : FOREACH. With FOREACH, it will loops through a block of code for each element in an array.

The FOR loop provides a compact way to create a loop with a specified number of times. We use the FOR loop when we know in advance how many times a block of code should run or execute. The FOR loop is also known as definite loop and it’s preferred by most programmers because it’s more convenient to use. See following example performs the FOR loop. … continue reading : Basic Learning PHP : Looping.

1 September 2009 at 13:01 - Comments

Basic Learning PHP: Introduction Array in PHP

Author : admin

Arrays are kings of advanced data structure in PHP, extremely flexible and can do practically anything we can possibly imagine. As variable, an array is a special variable because an array is a data structure that stores one or more values in a single value.

All arrays are ordered collections of items, it’s called elements. Each element has a value that is identified by a key that is unique to the array it belongs to, it’s called index. So, each element in the array has it’s own index that it can be easily accessed. … continue reading : Basic Learning PHP: Introduction Array in PHP.

16 August 2009 at 12:57 - Comments

Basic Learning PHP : PHP Comments

Author : admin

In the previous tutorial, we learn how to select and use the PHP tags. In this tutorial, we will discuss how to give the best comment in the PHP Script. As with PHP tags, PHP gives we multiple choices for our comments in the PHP Scripts.

Syntax comments in PHP always begins with a special character sequence and all text that appears between the start of the comment and the end will be ignored. PHP’s comments will not be displayed to our visitors. It’s only way to view when we are editing and only useful to PHP programmers. A comment is some part of a script file which the interpreter will ignore it when the script executes. There are two type syntax comments available : single line and multiple line comment. … continue reading : Basic Learning PHP : PHP Comments.

13 August 2009 at 16:25 - Comments