Menu Samaritan's Purse

STRVAL

Get string value of a variable

SYNTAX

strval ( mixed $var ) : string

PARAMETERS

var

The variable that is being converted to a string. var may be any scalar type or an object that implements the __toString() method. You cannot use strval() on arrays or on objects that do not implement the __toString() method.

RETURN

The string value of var.

EXAMPLES

1

object(myclass)#1 (0) {
}
string(7) "myclass"

2

NULL
string(0) ""

bool(false)
string(0) ""

bool(true)
string(1) "1"

int(-9223372036854775808)
string(20) "-9223372036854775808"

int(9223372036854775807)
string(19) "9223372036854775807"

int(0)
string(1) "0"

int(1)
string(1) "1"

int(23)
string(2) "23"

int(0)
string(1) "0"

int(0)
string(1) "0"

int(-1)
string(2) "-1"

int(1)
string(1) "1"

int(-23)
string(3) "-23"

int(23)
string(2) "23"

int(0)
string(1) "0"

int(1)
string(1) "1"

int(19)
string(2) "19"

int(0)
string(1) "0"

int(1)
string(1) "1"

int(35)
string(2) "35"

float(0)
string(1) "0"

float(1.1)
string(3) "1.1"

float(23.45)
string(5) "23.45"

float(0)
string(1) "0"

float(10000000000)
string(11) "10000000000"

float(230000000000)
string(12) "230000000000"

string(0) ""
string(0) ""

string(1) "0"
string(1) "0"

string(1) "1"
string(1) "1"

string(2) "23"
string(2) "23"

string(2) "-0"
string(2) "-0"

string(2) "+0"
string(2) "+0"

string(2) "-1"
string(2) "-1"

string(2) "+1"
string(2) "+1"

string(3) "-23"
string(3) "-23"

string(3) "+23"
string(3) "+23"

string(2) "00"
string(2) "00"

string(2) "01"
string(2) "01"

string(3) "023"
string(3) "023"

string(3) "0x0"
string(3) "0x0"

string(3) "0x1"
string(3) "0x1"

string(4) "0x23"
string(4) "0x23"

string(3) "0.0"
string(3) "0.0"

string(3) "1.1"
string(3) "1.1"

string(5) "23.45"
string(5) "23.45"

string(4) "0e10"
string(4) "0e10"

string(4) "1e10"
string(4) "1e10"

string(5) "23e10"
string(5) "23e10"

string(4) "0abc"
string(4) "0abc"

string(4) "1abc"
string(4) "1abc"

string(5) "23abc"
string(5) "23abc"

string(5) "-0abc"
string(5) "-0abc"

string(5) "+0abc"
string(5) "+0abc"

string(5) "-1abc"
string(5) "-1abc"

string(5) "+1abc"
string(5) "+1abc"

string(6) "-23abc"
string(6) "-23abc"

string(6) "+23abc"
string(6) "+23abc"

string(5) "00abc"
string(5) "00abc"

string(5) "01abc"
string(5) "01abc"

string(6) "023abc"
string(6) "023abc"

string(6) "0x0abc"
string(6) "0x0abc"

string(6) "0x1abc"
string(6) "0x1abc"

string(7) "0x23abc"
string(7) "0x23abc"

string(6) "0.0abc"
string(6) "0.0abc"

string(6) "1.1abc"
string(6) "1.1abc"

string(8) "23.45abc"
string(8) "23.45abc"

string(7) "0e10abc"
string(7) "0e10abc"

string(7) "1e10abc"
string(7) "1e10abc"

string(8) "23e10abc"
string(8) "23e10abc"

string(3) "abc"
string(3) "abc"

string(4) "abc0"
string(4) "abc0"

string(4) "abc1"
string(4) "abc1"

string(5) "abc23"
string(5) "abc23"

string(5) "abc-0"
string(5) "abc-0"

string(5) "abc+0"
string(5) "abc+0"

string(5) "abc-1"
string(5) "abc-1"

string(5) "abc+1"
string(5) "abc+1"

string(6) "abc-23"
string(6) "abc-23"

string(6) "abc+23"
string(6) "abc+23"

string(5) "abc00"
string(5) "abc00"

string(5) "abc01"
string(5) "abc01"

string(6) "abc023"
string(6) "abc023"

string(6) "abc0x0"
string(6) "abc0x0"

string(6) "abc0x1"
string(6) "abc0x1"

string(7) "abc0x23"
string(7) "abc0x23"

string(6) "abc0.0"
string(6) "abc0.0"

string(6) "abc1.1"
string(6) "abc1.1"

string(8) "abc23.45"
string(8) "abc23.45"

string(7) "abc0e10"
string(7) "abc0e10"

string(7) "abc1e10"
string(7) "abc1e10"

string(8) "abc23e10"
string(8) "abc23e10"

INTERNAL

boolval

floatval

intval

EXTERNAL

PHP