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: 
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
Post a Comment