Concept

How can you create and reassign strings in PHP?

ComputerScienceOne / Basics

"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