[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 510
  • Last Modified:

PHP heredoc syntax error

Hi,

i want to use heredoc syntax in php , but php sintax block code don't stop, all my html code at the bottom like string.

Error is like on picture, an anyone  tell me where is my error?
I use eclipse

Thanks
<?php
 
 
								echo <<<EOD
                                    <div id="errordiv_php">
                                        <div id="Naslov" class="errfontcaption_php" >
                                           <label >5 <>;8<5 ?>?@025B5 38 A;54=8B5 ?>40B>F8:</label>
                                
                                        </div>
                                            
                                        <p id="Ime" class="errlabel_php">
                                           <label >* 5 <>;8<5 2=5A5B5 3> 20H5B> 8<5!</label>
                                        </p>
                                       </div> 
								EOD; 
                        
					
						
                        ?>      
                    
                                    <div id="errordiv_php">
                                        <div id="Naslov" class="errfontcaption_php" >
                                           <label >5 <>;8<5 ?>?@025B5 38 A;54=8B5 ?>40B>F8:</label>
                                
                                        </div>
                                            
                                        <p id="Ime" class="errlabel_php">
                                           <label >* 5 <>;8<5 2=5A5B5 3> 20H5B> 8<5!</label>
                                        </p>
                                       </div>

Open in new window

error.JPG
0
nikola_mk
Asked:
nikola_mk
2 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
the EOD must be on the beginning of the line, not in the middle (after spaces) .
0
 
nikola_mkAuthor Commented:
Can you correct my code and send to me?

I try this but no effects:


echo <<<EOD
<div id="errordiv_php">
<div id="Naslov" class="errfontcaption_php" >
<label >5 <>;8<5 ?>?@025B5 38 A;54=8B5 ?>40B>F8:</label>
</div>                                          
<p id="Ime" class="errlabel_php">
<label >* 5 <>;8<5 2=5A5B5 3> 20H5B> 8<5!</label>
</p>
</div>
EOD;
0
 
shobinsunCommented:
Hi,

Try with this:


<?php
 
 
                                                                echo '
                                    <div id="errordiv_php">
                                        <div id="Naslov" class="errfontcaption_php" >
                                           <label >5 <>;8<5 ?>?@025B5 38 A;54=8B5 ?>40B>F8:</label>
                                
                                        </div>
                                            
                                        <p id="Ime" class="errlabel_php">
                                           <label >* 5 <>;8<5 2=5A5B5 3> 20H5B> 8<5!</label>
                                        </p>
                                       </div> 
                                                                '; 
                        
                                        
                                                
                        ?>      
                    
                                    <div id="errordiv_php">
                                        <div id="Naslov" class="errfontcaption_php" >
                                           <label >5 <>;8<5 ?>?@025B5 38 A;54=8B5 ?>40B>F8:</label>
                                
                                        </div>
                                            
                                        <p id="Ime" class="errlabel_php">
                                           <label >* 5 <>;8<5 2=5A5B5 3> 20H5B> 8<5!</label>
                                        </p>
                                       </div>

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now