duminică, 13 ianuarie 2013

A php bug - wtf case

Hey there,
Well something strange happend to me in php and i will give you my example
<?php
$a 
= array('6.1');var_dump(in_array('6.10'$a));?>
The output of the var_dump function is bool(true)... It's very strange because $a it's a string.

vineri, 20 aprilie 2012

Rose gold wedding rings

You have lastly found the adore of your life. You are prepared to intertwine your future life and your fate with theirs simply because you really like them so significantly. This is because these rings are numerous in colors and design. Because copper alloy provides distinct colors, you are going to locate lots of ring jewelries incorporating copper alloy. Thus, the jewelers can come across different hues by reducing or growing the copper proportion. To produce various designs, the jewelers make use of various settings which include bezel.

A distinctive gemstone apart from a diamond can develop this band in fact unique. A pink gold diamond ring can seem like a very easy fashion ring to be worn on any finger. When comparing gold rings, white gold is generally far more high priced than rose gold or yellow gold. The quite a few common selection is yellow gold, though rose gold and white gold are as well common.

Hence, rose gold engagement rings had been among typical jewelries of those times. Gradually, engagement rings with rose gold as a metal are finding place amongst designer rings. The precious metal itself could be the only solid thing in rose gold rings.

Rose gold wedding rings add a sense of fashion in this unique adornment. Gold comes in different colors for instance white, yellow, rose, tri-color, two-tone gold, etc. The major difference between yellow, white and rose gold will be the kind of material mixed with the it. To generate rose gold jewelry, generally 25 percent copper is blended with 75 percent pure gold.

This is mainly because having said that rose gold rings are rare jewelry. More couples nowadays decide on rose gold engagement rings than just before. Clearly, you can find many sorts of engagement rings of rose gold that to make a decision from. Rose gold engagement rings come in quite a few designs.

marți, 26 octombrie 2010

Best practice when using for sintax

Best way to use for sintax

<?php
 for($i=0;$i<$nr;++$i){ /*code*/ } 
?>

Where $nr is an integer.
Note: ++$i is way better than $i++, the reason is that $i++ creates a variable, while ++$i doesn't. So the speed of the process will be better.

PHPmaniac presents you best methods and practices!

marți, 19 octombrie 2010

Free memory usage (RAM)

When you're coding please consider the use of ressources, best way to optimize a code is to make sure that there aren't any memory leaks.

Using the command unset($variable,$var2) you can free the memory that is allocated by variable/constats.

I will give a simple example, how to use that function

<?php 
$a="something";$b="2";$c[0]="x"; $c[1]="yes";
//free memory usage
unset($a,$b,$c);
//after you used unset, $a,$b,$c will be NUL
?>

Simple and eficient!

duminică, 17 octombrie 2010

Get ip address

This is how to get an ip adress with php, included both, seerver and client.

<?php 
echo $_SERVER['REMOTE_ADDR']; //user ip
echo $_SERVER['SERVER_ADDR']; //server ip
?>