January 4th, 2008
Ok, seriously give Martin Schmidt some serious accolades on this because this solution is a very rare find and even tougher to figure out on your own. Thanks Martin!
-
-
//Begin Transparent Color Resize Correction for Gif and 8bit Png, by Martin Schmidt
-
$destImg = imagecreatetruecolor( $picx, $picy );
-
$colorcount = imagecolorstotal($logoImg);
-
imagetruecolortopalette($destImg,true,$colorcount);
-
imagepalettecopy($destImg,$logoImg);
-
$transparentcolor = imagecolortransparent($logoImg);
-
imagefill($destImg,0,0,$transparentcolor);
-
imagecolortransparent($destImg,$transparentcolor);
-
//End Transparent Color Resize Correction
Posted in PHP, Code Examples | No Comments »
September 20th, 2007
Most web developers will say you have to do all these IF statements and what-not just to get a zero in front of a number. Example, I want an 8 digit date (mmddyyyy). ASP will only generate a single digit “1″ for January and a single digit “1″ for the first. This means I end up with 112007. Not good. Here’s a sample to solve this problem :
<%
str= “1″
str=right(”00″ & str, 2) // returns “01″
%>
Perfect! What this is doing is adding 00 to str, so it then becomes “001″, then it takes the two right-most characters. Returning “01″. This is good because if you have a two digit day or month, then the two right-most characters are the two digits of that day or month. Bam! Easy huh?
Posted in ASP | Comments Off
August 28th, 2007
-
-
-
-
-
-
-
-
-
-
if($row[‘name’]==$row2[‘name’])
-
-
}
-
-
}
Posted in MySQL, PHP, Code Examples | 2 Comments »