Jump to content
Sign in to follow this  
adam.jones2

Output PHP in {}

Recommended Posts

Either it's a string, or a heredoc syntax.

$num = 5;echo "There are {$num} elements"; // OR $num = 9;$str = <<<STRThere are {$num} elementsSTR;echo $str;

Share this post


Link to post
Share on other sites

I cant see any echos on the page <dl class="content"><dt>{$langues[$langue]['versa']}</dt><dd>${apacheVersion} </dd><dt>{$langues[$langue]['versp']}</dt><dd>${phpVersion} </dd></br> <dd><ul>

Share this post


Link to post
Share on other sites

You might be looking at a template. They might also use print instead of echo. It's hard to tell by only seeing pieces of the code.

Share this post


Link to post
Share on other sites

Right above the HTML, you can see

$pageContents = <<< EOPAGE

and at the end of the HTML, you can see

EOPAGE;echo $pageContents;

So this is a HEREDOC, as demonstrated by Ingolme.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...