Assigning Values to Variables like in Perl

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
webcan
Forum Commoner
Posts: 66
Joined: Tue Oct 28, 2003 2:25 pm
Location: Toronto, Canada

Assigning Values to Variables like in Perl

Post by webcan »

Hey there -

In Perl, you can assign values to a variable in a freeform sort of format by doing the following:

Code: Select all

($body = <<END);
whatever you want
blah blah blah
123 $othervariable
END
In this case, the $body variable would contain all the stuff on those three lines, including the actual value of $othervariable.

Can this be done in PHP?

Thanks,
Peter.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

webcan
Forum Commoner
Posts: 66
Joined: Tue Oct 28, 2003 2:25 pm
Location: Toronto, Canada

Post by webcan »

Thanks!!
Post Reply