Use the current filename as the HTML body id // Makes the body id = the current filename - extension // Useful while working on static markup that relies on styles/scripts targeting the current page <?php $page = $_SERVER['PHP_SELF']; $page = str_replace("/","",$page); $page = str_replace(".php","",$page); ?> <body id="<?php echo $page ?>"> Random password generator in php A little function which generates random password of a certain length it uses all letters both lowercase and uppercase and all number //generates a random password which contains all letters (both uppercase and lowercase) and all numbers function generatePassword($length) { $password=''; for ($i=0;$i<=$length;$i++) { $chr=''; switch (mt_rand(1,3)) { case 1: $chr=chr(mt_rand(48,57)); break; case 2: $chr=chr(mt_rand(65,90)); break; case 3: $chr=chr(mt_rand(97,122)); } $password.=$chr; } return $password; } Convert from tis to utf <?php $content = @file_get_contents("http://www.manager.co.th/RSS/Sport/Sport.xml"); header("Content-Type: text/xml; charset=utf-8"); echo iconv('windows-874', 'utf-8', $content); ?>