Returned 5 Results for "php"

PHP Hash Maker - MD5, SHA1 etc


2009-08-22 Digg! icurtain Delcious icurtain Technorati icurtain


The Hash maker is a quick and easy way to either make hashes and use them directly or try to work out what your lost password was

I find it quite useful to be able to generate hashes for passwords directly for the purposes of resetting passwords directly in a database


dbPHP - Object Relational Mapping for PHP


2009-05-16 Digg! icurtain Delcious icurtain Technorati icurtain


banner


PHP Colour Changing Background Algorithm


2009-03-24 Digg! icurtain Delcious icurtain Technorati icurtain


This returns the average colour of an image in PHP using GD libraries and then, assuming you ahve no sense of design, you could use this to set the background colour of a page. This code can be slotted directly into the ImageHandler class also on this site

  1.    public function getAverageColour(){ 
  2.       $colours = array('red'=>0,'green'=>0,'blue'=>0); 
  3.       $count = 0; 
  4.       $rgbstring = null; 
  5.        
  6.       for ($i=0;$iimage);$i++){ 
  7.          for ($j=0;$jimage);$j++){ 
  8.             $rgb = imagecolorat($this->image, $i, $j); 
  9.             $ici = imagecolorsforindex($this->image, $rgb); 
  10.             //print_r($ici); 
  11.             foreach($colours as $key => $value){ 
  12.                $colours[$key] = $colours[$key] + $ici[$key]; 
  13.             } 
  14.          $count++; 
  15.          } 
  16.       } 
  17.       foreach($colours as $key => $value){ 
  18.                $colours[$key] = dechex(intval($colours[$key] / $count)); 
  19.                $rgbstring = $rgbstring . sprintf("%02s", $colours[$key]); 
  20.             } 
  21.       return $rgbstring;    
  22.    }

PHP Get/Set Generator - getters and setters for public functions


2008-07-23 Digg! icurtain Delcious icurtain Technorati icurtain


get/set code generator for PHP - all Java development environments allow you to generate getter and setter code automatically

enter comma seperated variable names: size, length, width, etc


PHP Variable Variables..


2008-07-01 Digg! icurtain Delcious icurtain Technorati icurtain


$var = "value";
$value = "some value";
echo $$var;

For some insane reason PHP allows you to have variable variables.. if you ever use these you should probably be prohibited from using a computer again