How to check whether a value is a string with is_string() in PHP

1 Answer

0 votes
$s = "PHP";
if (is_string($s)) 
    echo '$s is a string';
else
    echo '$s is NOT a string';


/*
run: 

$s is a string  

*/


answered Jun 3, 2014 by avibootz
edited Jul 2, 2016 by avibootz

Related questions

1 answer 217 views
1 answer 173 views
1 answer 185 views
1 answer 217 views
3 answers 186 views
2 answers 259 views
...