Installing ImageMagick on Windows — Setup Imagick on PHP
I was trying to install ImageMagick on Windows. I got the correct binary file, but when I tried to invoke it with the PHP extension (php_imagick.dll) it was...
Two of the many comparison operators used by PHP are ‘==’ (i.e. equal) and ‘===’ (i.e. identical). The difference between the two is that ‘==’ should be used to check if the values of the two operands are equal or not. On the other hand, ‘===’ checks the values as well as the type of [...]
Two of the many comparison operators used by PHP are ‘==’ (i.e. equal) and ‘===’ (i.e. identical). The difference between the two is that ‘==’ should be used to check if the values of the two operands are equal or not. On the other hand, ‘===’ checks the values as well as the type of operands.
Let me explain more using some examples:
‘==’ (Equal):
if(“22″ == 22) echo “YES”;
else echo “NO”;
The code above will print “YES”. The reason is that the values of the operands are equal. Whereas when we run the example code below:
‘===’ (Identical):
if(“22″ === 22) echo “YES”;
else echo “NO”;
The result we get is “NO”. The reason is that although values of both operands are same their types are different, “22″ (with quotes) is a string while 22 (w/o quotes) is an integer. But if we change the code above to the following:
if(“22″ === (string)22) echo “YES”;
else echo “NO”;
Then, the result will be “YES”. Notice that we changed the type of right operand to a string which is the same as the left operand (i.e. string). Now, the types and values of both left and right operands are the same hence both operands are identical.
I was trying to install ImageMagick on Windows. I got the correct binary file, but when I tried to invoke it with the PHP extension (php_imagick.dll) it was...
I just spent the last 2 hours chasing my tail trying to figure out a install problem I was having with Drupal: Symptom When logging into Drupal for...
Ajax requests suffer from the same Cross Site Request Forgery attack vectors as normal pages. Many developers assume that a given ajax request will only take place on...
What is SQL injection? It is a basically a trick to inject SQL command or query as a input mainly in the form of the POST or GET...
Don’t you just hate it when you have to write very long codes such as below? $name = mysql_real_escape_string(strip_tags($name)); $email = mysql_real_escape_string(strip_tags($email)); $address = mysql_real_escape_string(strip_tags($address)); Even if you...
Features * Send entire form when one element changes * Send just the changed element * Form buttons and input:submit is not sent unless clicked * Override action/method...
By default, MySQL is enabled with strict_mode ON. Mambo currently does not fully support MySQL5.x in strict_mode (this is on the roadmap and will be dealt with when...
Before we get into the details, here are a few factoids to give you an idea of the scaling challenge that Facebook has to deal with: * Facebook...
I thought most of the programmer understand the comparison operators in PHP and what NULL was in the language. I was sadly mistaken and it caused me a...
June 29, 2010
June 16, 2010
June 10, 2010
Recent Comments