Get and Set Element Attributes with MooTools

I am going to show how to set and get attributes of the any elements like title, id, class, etc. This methods are available from very first version of the MooTools because we can say these are the most used functions of the MooTools if you are playing with the DOM. Set the Attributes function […]

PHP clearstatcache() Explained

For the functions like , , etc PHP caches the result of this function for each file for faster performance if function called again. But in some cases you want to clear this cached information, for the task like getting the information of the same file multiple times in same page. Points to be note […]

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 […]

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: 123456$file = "/path/to/the/file"; $fp = fopen($file, "r"); while ( $line […]

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 […]

Set Error Document with .htaccess

.htaccess file has a great command over websites. You can perform lots of things without changing the web server’s configuration file.

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.

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 12345 # protect file  <Files personal_data.txt> […]