Jump to content
Larry Ullman's Book Forums

Wrapping $_Post Variables In Curly Braces


Recommended Posts

In Chapter 11 in the sending email script called email.php, the $_POST['name'] and $_POST['comments'] in the $body variable are wrapped in curly braces. Why are there curly braces around them. 

See the code below.

if ($_SERVER['REQUEST_METHOD'] == 'POST'){
	if (!empty($_POST['name']) && !empty($_POST['email']) && !empty($_POST['comments'])){
		$body = "Name: {$_POST['name']}\n\nComments: {$_POST['comments']}";
		$body = wordwrap($body, 70);
	}
}
Link to comment
Share on other sites

 Share

×
×
  • Create New...