In PHP, a string is text: a sequence of characters used for names, messages, HTML, file paths, and almost every piece of text a script prints or reads.
You create strings with single quotes, double quotes, or heredoc/nowdoc. Join them with the . operator. Built-in helpers such as strlen(), explode(), and htmlspecialchars() are global functions—you call them by name, not with object dot methods.
This page teaches what a PHP string is. The String Functions index lists every function guide in this series.
Single vs double quotes.
Double quotes expand variables ("Hi, $name"). Single quotes print $name literally. Prefer single quotes when you do not need expansion.
Assign the result.
Helpers return a new string. Write $upper = strtoupper($text);—calling the function alone does not change $text.
A string is a sequence of characters used for text—names, messages, HTML, and file paths. You write strings in single quotes, double quotes, or heredoc/nowdoc syntax.
Double-quoted strings expand variables and many escapes ("Hello, $name"). Single-quoted strings are mostly literal—only \\ and \' are special. Use single quotes when you do not need variable expansion.
Use the dot operator: $full = $first . ' ' . $last;. Append with .= : $text .= ' more';. echo can also print several pieces separated by commas.
No. Helpers like strtoupper(), trim(), and htmlspecialchars() return a new string. Assign the result: $safe = htmlspecialchars($raw);
Practice the examples on this page, then open the String Functions index for explode(), implode(), htmlspecialchars(), and every other function guide in this PHP tutorial series.