Make a string’s first character uppercase

ucfirst — Make a string’s first character uppercase example: $coo= ‘clay desiccant!’; $coo= ucfirst($desiccant); // Clay desiccant! $bar = ‘CLAY DESICCANT!’; $bar = ucfirst($bar); // CLAY DESICCANT! $bar = ucfirst(strtolower($bar)); // Clay desiccant!

Using php to control many domains withing one web host

can build many web sites, with one web host, one site with one different domain, just using php, it can make you very happy, save your money. $arrays=array( ’www.money.com’=>’money/index.html’, ’www.insurance.com’=>’insurance/index.html’, ’www.car.com’=>’car/index.html’, ’www.travel.com’=>’travel/index.html’, ’127.0.0.1’=>’forum/index.php’, ); $url = $arrays[$_SERVER[’HTTP_HOST’]]; Header(”Location: $url”); ?>

Php generate random numbers

/*random function $length: length of needed number */ function random($length) { $hash = ”; $chars = ‘0123456789′; $max = strlen($chars) – 1; mt_srand((double)microtime() * 1000000); for($i = 0; $i < $length; $i++) { $hash .= $chars[mt_rand(0, $max)]; }

rename()

— Renames a file or directory Description bool rename ( string $oldname , string $newname [, resource $context ] ) Attempts to rename oldname to newname .

how to use php generate passwords

Here are 2 kind php code can generat strong passwords: $password_length = 9; function make_seed() { list($usec, $sec) = explode(’ ‘, microtime()); return (float) $sec + ((float) $usec * 100000); } srand(make_seed()); $alfa = “1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM”; $token = “”; for($i =… Read morehow to use php generate passwords