Trying to figure out what "<<<HERE" is in PHP code

  • jamesbond
  • Novice
  • Novice
  • jamesbond
  • Posts: 23

Post 3+ Months Ago

I cam across something in some code i have never seen before in php and was wondering if someone could explain it is the <<<HERE in script below can someone tell me if its needed please

<php>

$theStyle = <<<HERE <--what is this for <<<HERE part and were it closes on the bottom
"border-width:$borderSize$sizeType;
border-style:$borderStyle;
border-color:green";

print"<div style = $theStyle>";
print $basicText;
print "</div>"
HERE;
</php>
  • jamesbond
  • Novice
  • Novice
  • jamesbond
  • Posts: 23

Post 3+ Months Ago

never mind i found out it was block scripting the problem was it had to be all the way to the left on its own line lol duhhhh
  • WritingBadCode
  • Graduate
  • Graduate
  • User avatar
  • Posts: 214
  • Loc: Sweden

Post 3+ Months Ago

Good thing you solved it.

That's called Heredoc syntax, for anyone else reading the thread and might feel like researching it more.

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 117 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.