Twice now this week, which is impressive as it is only Tuesday, questions about variable types have popped up on IRC chat about how strings get evaluated and converted. PHP has the soft variable type system that allows you to do things like compare strings to integers, or take a variable that used to be an integer and store a string in it instead. This is unlike the strict typing of languages like C where when you create an integer variable, you better not be trying to store anything except an integer in it.

To hopefully clarify things for more people and also create a link I can send instead of re-explaining it every time, lets take a look at comparing and converting strings.

Continue reading about comparing and evaluating strings…