Open In App

PHP | is_string() Function

Last Updated : 27 Apr, 2020
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report
The is_string() function is an inbuilt function in PHP which is used to check whether the given value is a string or not. Syntax:
bool is_string( mixed $var )
Parameters: This function accepts one parameter as mentioned above and described below:
  • $var: It contains the value that need to check.
Return Value: It returns TRUE if the value of variable is of string type and FALSE otherwise. Program 1:
Output:
String
Not String
Not String
String
Not String
String
Program 2:
Output:
bool(false)
bool(true)
bool(false)
bool(true)
Reference: https://www.php.net/manual/en/function.is-string.php

Next Article

Similar Reads