Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

PHP vs ColdFusion/Inserting Variables

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Inserting Variables Both languages allow you to insert variables at any point. This is very useful if you have many lines of HTML, but only need to insert something simple. We will use the variable we created above. PHP: Message holds: <?=$message; ?> (Note: This will not work in php if short open tags are disabled. This was enabled by default as of php 4.0.0) ColdFusion: Message holds: <cfoutput>#message#</cfoutput> (Note: It is considered poor form in CFML to place <cfoutput> tags at the beginning and end of a page, as the parser must evaluate every word for variables). Both examples will print: Message holds: Hello World!