You can use the casting operators:
$myText = (string)$myVar;
There are more details for string casting and conversion in the Strings section of the PHP manual, including special handling for booleans and nulls.
More Related Contents:
- Remove empty array elements
- How can I get a hex dump of a string in PHP?
- Remove new lines from string and replace with one empty space
- PHP, get file name without file extension
- URL Friendly Username in PHP?
- PHP: Split string [duplicate]
- Mixing a PHP variable with a string literal
- Remove portion of a string after a certain character
- How can I replace a variable in a string with the value in PHP?
- php/mysql with multiple queries
- How do I linkify urls in a string with php?
- How to split a string by multiple delimiters in PHP?
- Check whether $_POST-value is empty
- How to get email address from a long string
- use strings to access (potentially large) multidimensional arrays
- String contains any items in an array (case insensitive)
- Structure of a Serialized PHP string
- format xml string
- How to cast array elements to strings in PHP?
- How to reverse a Unicode string
- remove duplicate from string in PHP
- How to Convert Boolean to String
- Regex & PHP – isolate src attribute from img tag
- Delete first 3 characters and last 3 characters from String PHP
- How can I get the last 7 characters of a PHP string?
- Remove all non-numeric characters from a string; [^0-9] doesn’t match as expected
- Convert a String to Variable
- Multi-byte safe wordwrap() function for UTF-8
- How to convert all characters to their html entity equivalent using PHP
- Limit String Length