PHP Web Development Tutorials

PHP Web Development Tutorials and Articles
  Title / Author Replies
Views
Introduction ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple Caesar cipher used in online forums as a means of hiding spoilers, punchlines, puzzle solutions, and offensive materials from the casual glance. ROT13 has been described as the "Usenet equivalent of a...
2
11,629
Recently, an obscure detail in the way PHP processes strings came to my attention. This is processed by code that checks for simple lists (like 1. blah 2. blah, or - blah - blah, etc.). However, an innocent call to in_array($x, array('1.', '0.')) had surprising and unexpected results: our...
1
10,203
password.class.php <?php /* * Simple password generator define ('PC_MINUS', 0x01); define ('PC_CAPITAL', 0x02); define ('PC_NUMBERS', 0x04); define ('PC_SPACES', 0x08);
5
5,603
Introduction PHP comes with an extensive catalog of date and time functions, all designed to let you easily retrieve temporal information, massage it into a format you require, and either use it in a calculation or display it to the user. However, if you'd like to do something more complicated,...
5
18,958
Many websites generate temporary password or some generate the Activiation code for verification of email. They send the mail with that code in it and so If you wonder how they do this here is a function to do this. Input : - Length of the Random string you wish to generate Output :- Random...
6
12,279
PHP can be used for a lot of different things, and is one of the most powerful scripting languages available on the web. Not to mention it's extremely cheap and widely used. However, one thing that PHP is lacking, and in fact most scripting languages are, is a way to update pages in real-time,...
5
11,843
Some web applications need to display numbers in words, like e-commerce, shopping web applications, so PEAR brings a package named Numbers_Words which converts numbers to words in 2 lines of PHP code. Checkout the example below. <?php require('Numbers/Words.php'); $number =...
6
11,339
I was wondering in how many ways can we iterate through an array in PHP. So, I figured out a few, here's it... Our Array, which we will be iterating on, $arr = array('PHP','Perl', 'JavaScript','AJAX', 'Python','ASP', 'C#'); 1. Using a simple for loop // using for loop ...
1
23,400
PHP is arguably the most popular scripting language for Web sites. This popularity comes with a price, however, and that is increased attention to various vulnerabilities in PHP itself and in the plethora of Web applications written in PHP. The security features built into PHP are weak, and the...
0
3,070
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,675
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,225
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
12,012
PHP will automatically convert data types as necessary across the board - you need not worry about it happening. If you specifically wish to override PHP's type conversion, you can perform what is called a type cast - you forcibly convert a variable of type A to type B. In PHP, type casting looks...
3
39,293
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,053
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,563
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,359
The below is a code to gauge ur php performance <?php function micro_time_val($mytime) { $gettime=explode(" ",$mytime); $msec=(double)$gettime; $sec=(double)$gettime; return ($sec + $msec);
8
3,385
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,867
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,116
Background I've needed the header function in php so many times I figured I'd write a tutorial on it. This tutorial should help you do most of the things that the header function is capable of. Simply put, the php header function will send a http header to the browser. Headers in PHP If...
4
4,412