Concept
How can you create and reassign strings in PHP?
"We can create strings by assigning a string literal value to a variable. Strings can be specified by either single quotes or double quotes (there are no individual characters in PHP, only single character strings), but we will use the double quote syntax.\n\n1 $firstName = \"Thomas\";\n\n2 $lastName = \"Waits\";\n\n3\n\n4 //we can also reassign values\n\n5 $firstName = \"Tom\"\n\nThe reassignment in the last line in the example effectively destroys the old string."
Related Ideas
- How can strings be created and assigned to variables?ComputerScienceOne · Basic Operations
- How do you assign values to variables in PHP?ComputerScienceOne · Using Variables
- How are strings, statements, and code blocks written in PHP?ComputerScienceOne · Basic Syntax Rules
- How are variables and variable types handled in PHP?ComputerScienceOne · Entry Point & Command Line Arguments
- How are String variables declared and reassigned in Java?ComputerScienceOne · Basics
- How can strings be modified or copied?ComputerScienceOne · Basic Operations
- How can you add or remove characters from a PHP string?ComputerScienceOne · String Functions
- How can you determine the length of a PHP string?ComputerScienceOne · String Functions