is_string
-
We can check if a variable is a string in Ruby using
Object#is_a?.PHP
$string = 'Hello world'; $result = is_string($string); var_export($result); // => true
Ruby
string = "Hello world" p string.is_a?(String) # => true
see also
Looking for Rails or PHP web application development, integration, and training?
Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.

