PHP Web Development Tutorials

PHP Web Development Tutorials and Articles
  Title / Author Replies Reverse Sort Order
Views
Haversine Formula The haversine formula is an equation important in navigation, giving great-circle distances between two points on a sphere from their longitudes and latitudes. It is a special case of a more general formula in spherical trigonometry, the law of haversines, relating the sides...
0
17,756
The PHP Extension and Application Repository (PEAR) is an open source structured library of packages for PHP developers. These packages provide routines which solve problems PHP developers regularly face: sending structured e-mail (such as an HTML attachment), interacting with different databases...
0
9,696
Manier times we require to create logs of various activities/errors in our web applications, so here we'll look into how to achieve that. Logging data to a file in PHP can be as simple or as complex as you want to make it. Break it down, though, and it all comes down to these three simple lines...
0
16,354
PHP offers one alternative - a special Log class that comes courtesy of PEAR, the PHP Extension and Application Repository (http://pear.php.net). In case you didn't know, PEAR is an online repository of free PHP software, including classes and modules for everything from data archiving to XML...
0
11,815
Introduction Suppose you want to know the age of a person given her birth date. Letís say her birth date is "09-23-1969". Although in this case you might say that we donít need a program to compute the age, but assuming there are 1000s of records in your database and for every person you have to...
0
65,150
Many times its required that we truncate a long string and add ellipsis to the end of the truncated string. Here's a function which does exactly that. function truncate( $varb, $num ) { $dnum = intval($num); if (strlen($varb)>$dnum) { $nvarb = substr($varb, 0,...
0
3,990
Management of files Manipulating files is a basic necessity for programmers and PHP gives you a great deal of tools for creating, uploading, and editing files. When you are manipulating files you must be very careful because you can do a lot of damage if you do some errors. Common errors include...
0
8,215
Sometimes we need to find the number of items, located inside an array.Let's take this array as example, $a=1; $a=3; $a=4; $a=5; here the total item count is 4, but when you use count() function you get 3. So I wrote a small function which counts array elements, even recursively. ...
0
5,030
If you have PHP4 working on your server, and have heard that PHP5 may screw up things. Here's how to have both running alongside. #!/bin/sh # PHP5 CGI Installer for cPanel/WHM Servers VERSION=5.0.4 cd /usr/src wget -O php.tbz2...
0
3,816
Morse code is a method for transmitting information, using standardized sequences of short and long elements, for the letters, numerals, punctuation and special characters of a message. The short and long elements can be formed by sounds, marks or pulses, and are commonly known as "dots" and...
0
6,491
All like to create PHP scripts as fast as possible, and we try to take any shortcuts that we have. Here are few tips to speed up php code Tip -1 Using a good editor can really save you time. If you're still stuck on using Notepad to edit your PHP scripts, switch right now. There are...
0
3,016
This is a guide, you will not have a stand-alone effect or file by the end of this guide, but you will - hopefully - have an understanding of the Unix timestamp that allows you a powerful form of managing your PHP applications. Note: This guide expects the reader to have an understanding on how...
0
11,934
Exceptions are used to change the normal flow of a script if a specified error occurs.Exception handling is used to change the normal flow of the code execution if a specified error (exceptional) condition occurs. This condition is called an exception.when an exception is triggered the current code...
0
7,133
When it becomes necessary to compare two or more text files in UNIX, most developers reach for the diff program. This program, included by default in almost all UNIX distributions, compares the files line by line and displays the changes between them in a number of different output formats. ...
0
17,488
This script adds some basic math functions to php allowing you to get percentages, ratios and other fraction based functions. Background I created this because I had a need for some math functions that php does not provide. I also made them for my math class to save on time from having to do...
0
2,320
This time I took a bit of a change from the usual subjects I write, not a big change though. The reason for writing this set of articles (More to come and there's another beginners one as well) is because I felt that there isn't a proper or complete guide written for the pure beginners to start...
0
4,158
Smarty is a templating engine for PHP, it's one of the most popular templating engine used by PHP developers. Using a templating engine helps businesses separate presentation logic & application logic. Templating, you can say is a way to separate the business logic from the presentation...
0
2,145
PHPExcel project provides a set of classes, which allow us to Read, Write and Create Excel documents in PHP. File formats, supported by PHPExcel are .xls, .xlsx, CSV, .ods, Gnumeric, PDF and HTML. Requirements for PHPExcel: PHP version >= 5.2.0 PHP extensions php_zip,php_xml,php_gd2...
0
3,846
Memcached is a high-performance open-source caching solution, generally used to improve web application performance by avoiding round-trips to RDBMS, to know more about memcached read Faster Webapps With Memcached. In this article we'll discuss about installing and using memcached in PHP. A PHP...
0
2,428
Creates a class that acts as a string wrapper similar to Java and C#. Background Php doesn't do types so I created a class to act as a wrapper to provide a faux type for strings The Code The code is designed so that you can create text variables which have there own methods that you...
0
1,673