tags:

views:

121

answers:

3

I have a variable that im define with another variable and some text.

$title = "New Amsbrook School" //demo text
$message = "$title just added, Congrats!";

Echoing of $message returns New just added, Contrats!

Problem is if there is a space in $title, it breaks and doesnt show the rest of the contents.

+3  A: 

You missed a semicolon at the end of $title string ;-)

Byron Whitlock
+1 - nice, I was scratching my head trying to figure out what the heck he was doing wrong. Figured it had to be something simple like that :)
Eric Petroelje
I'm stocked that it even got parsed. Patrick, make sure you have error-reporting turned on while developing. It will point this stuff out immediately.
Jonathan Sampson
+1  A: 

Needs a semi-colon at the end of the first line, before the comment.

codebunny
A: 

Works when i define the variable as the following.

$title = urlencode($row['title']);
Patrick