All Posts by : "Avinash"

Post image for is_file() and file_exists() in PHP

is_file() and file_exists() in PHP

These both functions are used to check the existence of the file. But there is a minor difference between these functions. Let’s see what’s the difference. 1) file_exists() This function takes the path as a parameter and return or . This function will return TRUE in case of file exists and FALSE in case if […]

Post image for Read Text File using PHP

Read Text File using PHP

Here is the simple trick to read the text file line by line. For this I am going to use the and function. This is code snippet I am going to take one text file and read it line by line. Let’s for the code: $file = “/path/to/the/file”; $fp = fopen($file, “r”); while ( $line […]

Post image for PHP Debugging Tools

PHP Debugging Tools

PHP is very well used scripting language in now a days. But PHP does not have any inbuilt debugging tools or extension. But we have some extensions and tools available which serves the debugging purpose of the PHP. 1) X-Debug X-Debug is the most used and very useful PHP extension. X-Debug will show the variables […]

Post image for PHP “Magic Quotes” Explained

PHP “Magic Quotes” Explained

First of let me say that Magic Quotes is deprected from the PHP 5.3 and will be removed completely from the PHP 6. But as a developer you might face a situation when you have to work on application which runs on older version of PHP with some older functionality like rely on Magic Quotes.

Post image for Protect file using .htaccess

Protect file using .htaccess

This post is about to explain the use of .htaccess for protecting any file on your server. Earlier I have explained the use of htaccess file to protect the .htaccess file. Here is the code which shows the trick to protect the file using .htaccess file. Protect File using .htaccess # protect file order allow,deny […]

Post image for Export Data into file using MySQL

Export Data into file using MySQL

With MySQL we can easily export our selected rows to the files. MySQL has several syntax which can export the retrieved rows into the file. Yes we can import these rows back to database tables also.

Post image for PHPMailer with PHP Send Mail

PHPMailer with PHP Send Mail

As I already posted earlier, PHP has several methods to send the mail. In this post I am going to cover the send mail using PHP Send mail. Earlier I have posted about the send mail using SMTP with PHPMailer. Before this I have posted about the send mail using SMTP with core PHP.