 |
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...
By pradeep
|
0 9,228 |
 |
I never recommend using " (double quotes) when programming with PHP. Always use ' (single quotes) unless you need the features of " (double quotes). You might think it's much easier to write code as:
echo "Today is the $day of $month";
However, using single quotes forces variables to be...
By pradeep
|
0 6,142 |
 |
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...
By pradeep
Last Message By LenoxFinlay
|
1 9,437 |
 |
This is temperature conversion script, used to convert temperature from Celsius, Fahrenheit, Rankine, and Kelvin.
The Code
Include the script in your php project and call one of the conversion functions with a numeric value as its parameter to get some output. You can convert from Celsius,...
By pein87
Last Message By Seo_Aryan
|
4 2,614 |
 |
Many sites send you a temporary password after u sign up with them. Here is is how you too can do that
function TempPassword($tp_len)
{
$pstring = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWXxYyZz0123456789";
$plen = strlen($pstring);
for ($i = 1; $i <= $tp_len; $i++)
...
By pradeep
Last Message By shabbir
|
1 5,225 |
 |
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...
By shabbir
Last Message By gkumar
|
6 8,499 |
 |
There are many different traffic analysis tools, ranging from simple counters to complete traffic analyzers. Although there are some free ones, most of them come with a price tag. Why not do it yourself? With PHP, you can easily create a log file within minutes. In this article I will show you how!...
By Kings
Last Message By cyclop
|
14 31,734 |
 |
File Transfer Protocol or popularly known as FTP has been a de facto standard for transferring files for many years, can be used in many programs / utilities like backup programs, etc. PHP is being increasingly used in writing scripts for maintenance and other purposes and the FTP extensions...
By pradeep
|
0 1,298 |
 |
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,...
By pradeep
|
0 2,739 |
 |
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...
By pradeep
Last Message By gunwant
|
3 37,991 |
 |
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...
By Mary
|
0 11,141 |
 |
The PDF (or portable document format) file is an amazingly versatile format for transferring what usually starts as a hard copy version of a document over the Internet. Many companies use the PDF format to transfer contracts, manuals, and other documents over the Internet without trying to convert...
By Sanskruti
Last Message By dean8710
|
2 15,179 |
 |
The in-built array functions allow you to interact with and manipulate arrays in various ways. Arrays are essential for storing, managing, and operating on sets of variables.
Simple and multi-dimensional arrays are supported, and may be either user created or created by another function. There...
By pradeep
Last Message By pein87
|
14 13,990 |
 |
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...
By pradeep
|
0 1,740 |
 |
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,...
By Mary
Last Message By gkumar
|
5 17,540 |
 |
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.
...
By pradeep
|
0 15,627 |
 |
All PHP coders are aware of the mail() function in PHP, which can be used to send mails. On Linux systems we ussually have Sendmail program installed, if someone is facing a problem sending mails with mail() function, they can alternatively use Sendmail to send mails.
For sending mails using...
By pradeep
Last Message By manilodisan
|
4 33,283 |
 |
Every web-applications needs to transfer data from one page to another and one of the way of doing it is using sessions in PHP..
Sessions are a special type of variables used to transfer/carry data from one page to others.. In this tutorial i’ll be covering PHP version 4.1.0 and above..
Using...
By lionaneesh
Last Message By vnexpress
|
10 5,427 |
 |
Let us say you have some images and want to watermark those images with some other gif, jpeg, png images or with some plain text on the fly in PHP.
It actually looks tough but it is very simple. Let us take a real time example of profile picture option we have here at Go4Expert.com where if you...
By shabbir
Last Message By jhon786
|
6 4,669 |
 |
Cookies are basically small files which are stored in User’s Computer. Their main purpose is to hold data specific to a particular client and Website, They can only be accessed either by Web Server or the client computer. This allows the server to access user specific data while saving space on the...
By lionaneesh
Last Message By lionaneesh
|
7 3,813 |