Make sure the variable is a string type before using string comparing function

Because sometime JSON data may be a multi dimension array as following:
array(
  "a": []
) 
In this case, this express will cause 2 PHP warning.
Merge pull request #32 from oyang/master

Better handling of multi-dimensional array JSON data