why my php code create unneccesary spaces? -


this php code. creating html codes below.

foreach($sorular->sorucek($_get["kategori"]) $data) {     $kontrol = $sorular->cevapcek($data["id"]);     if($kontrol)     {         echo $data["soru"] . '<br/>';             foreach(@$sorular->cevapcek($data["id"]) $veri)             {                 ?>                 <input type="radio" name="soru<? echo $data["id"]; ?>" value="<? echo $veri["id"]; ?>"/><? echo $veri["cevap"]; ?>                 <?                 echo "<br/>";             }         echo "<br/>";     } } 

result: enter image description here

php templated language. spaces outside of php tags sent browser.

<?php $a = 'foo';?>                         <input type="string" /> <?php $b = 'bar';?> 

input indented many spaces. regarding 'formatting' html markup:

1) don't worry formatting html long validates or displays correctly in browser.

2) should minifying output anyway, eliminating spaces.

3) if want html prim-and-proper can use tidy on output.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -