downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<is_scalaris_unicode>
Last updated: Thu, 26 Jun 2008

is_string

(PHP 4, PHP 5)

is_string — Find whether the type of a variable is string

Description

bool is_string ( mixed $var )

Finds whether the type given variable is string.

Parameters

var

The variable being evaluated.

Return Values

Returns TRUE if var is of type string, FALSE otherwise.

Examples

Example #1 is_string() example

<?php
if (is_string("23")) {
 echo
"is string\n";
} else {
 echo
"is not an string\n";
}
var_dump(is_string('abc'));
var_dump(is_string("23"));
var_dump(is_string(23.5));
var_dump(is_string(true));
?>

The above example will output:

is string
bool(true)
bool(true)
bool(false)
bool(false)



add a noteadd a note User Contributed Notes
Find whether the type of a variable is string
There are no user contributed notes for this page.




<is_scalaris_unicode>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs