PHP define variable using plain text

There’s a comfortable way to define variable in PHP.

For example,

	$text = <<<QQQ
Often called the “Atlantis of the East” by travellers, the underwater city of Shicheng is a 
magnificent, mysterious time capsule of Imperial China. Stone architecture dating 
to the Ming and Qing dynasties (which ruled from 1368 to 1912) stands perfectly 
preserved 40m under Qiandao Lake in Zhejiang province, 400km south of Shanghai.


Note, that closed construction QQQ must be set in the beginning of the line, no spaces.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment Notes of web-specialist
Since 2009