--- title: PHP strings --- They are sequences of characters, like "PHP supports string operations". NOTE − Built-in string functions is given in function reference PHP String Functions Following are valid examples of string $string_1 = "This is a string in double quotes"; $string_2 = "This is a somewhat longer, singly quoted string"; $string_39 = "This string has thirty-nine characters"; $string_0 = ""; // a string with zero characters Singly quoted strings are treated almost literally, whereas doubly quoted strings replace variables with their values as well as specially interpreting certain character sequences. ``` "; $literally = "My $variable will print!\\n"; print($literally); ``` This will produce the following result − ``` My $variable will not print!\n My name will print ``` There are no artificial limits on string length - within the bounds of available memory, you ought to be able to make arbitrarily long strings. Strings that are delimited by double quotes (as in "this") are preprocessed in both the following two ways by PHP − Certain character sequences beginning with backslash (\) are replaced with special characters Variable names (starting with $) are replaced with string representations of their values. The escape-sequence replacements are − \n is replaced by the newline character \r is replaced by the carriage-return character \t is replaced by the tab character \$ is replaced by the dollar sign itself ($) \" is replaced by a single double-quote (") \\ is replaced by a single backslash (\) ### String Concatenation Operator To concatenate two string variables together, use the dot (.) operator − ```