How to chage wamp installed directory?
Here, I am going to guide how to changed wamp installed directory. Please follow below steps; Step 1: copy your wamp folder (the default location is c:\\wamp) Step 2: Past your wamp folder your desired location ( for […]
$_SERVER PHP Variable usages with example
$_SERVER in PHP is very useful to getting lot of information about the PHP script in execution as well as the server/request details. $_SERVER is containing information such as headers, paths, and script locations. The entries(values) in this array are […]
PHP directory listing script
I here explained to list the directory files using php (server side scripting language). <?php function list_files($dir) { if(is_dir($dir)) { if($handle = opendir($dir)) { while(($file = readdir($handle)) !== false) { if($file != "." && $file != ".." && […]
PHP date format validation
Here, We need to function to validate date format 1. preg_match() -> used to check the date format ( like “YYYY-MM-DD” ) 2. checkdate() -> used to check whether date valid or not ( For eg “2013-13-21″ not a vlid […]
Generate random key in php
This below snippet is create random string. you can use as a authentication code or some other purpose. <?php $string = "abcdefghijklmnopqrstuvwxyz0123456789"; for($i=0;$i<25;$i++){ $pos = rand(0,36); $str .= $string{$pos}; } echo $str; ?> The above function will return 25 charecter […]