Recently I need to use file for caching little bit of data. Then I thought of concurrency problem can arise in File based structure due to read/write issue. For small data and that also if not so useful , usage of Database can be avoided. Though Database can handle any kind of conflict and other [...]
Finding the correct relative path for use in you php page for include/require.
I need to get all the parent folders of a File for a work. I searched on net to find easy solution for this and also to find some tips for my work. As, my work was heavily dependent on this logic, so I have given some time to it. But whatever I have found [...]
It is an online HTML characters encoding tool for posting script to webpage or blogs. Suitable for all who posts HTML, PHP, JavaScript and other kind of codes on blog.
Get all files included in current scope in a PHP script. File included using require, require_once,include, include_once all will be captured.
Files residing in a deep directory and you want to set include path for all those files,
you can set it using ini_set() or set_include_path().
Find the visitors’ real IP address and know how to store it in database. Discussion about the various ways to handle the IP address for storing and comparison.
In case, you do not have option of using server side header directive then you can use HTML method of 301 permanent redirect.
This is custom error handler in PHP. You can use your custom error handler for showing the error in you customized format, logging the error in a log file and for other reason.
<?php
//error handler function
function customError($errno, $errstr, $fileName, $lineNo)
{
switch ($errno) {
// fatal error. die it.
case E_USER_ERROR:
echo [...]
CSV file is a text file, so this type of file can easily be opened in MS Word. Just use your MS Word Menu File->Open. Or right click on file and use “Open With…”. Select “Microsoft Word for Window”.
CSV file data can easily be converted into table structure in MS Word application. For converting [...]