Skip to content
Advertisement

How do i debug my php code inside my html?

I’m using Laravel for my project. I wrote some PHP code inside HTML which basically under my .blade.php file. I’m trying to debug variable $highestRow inside tbody tag.

<tbody>
   <?php
   $objPHPExcel->setActiveSheetIndexByName('Xns');
   $highestRow = $objPHPExcel->setActiveSheetIndex(14)->getHighestRow();
   for($i=1;$i<=$highestRow;$i++){
      $dataC = $objPHPExcel->getActiveSheet(0)->getCell('A'.@$i)->getCalculatedValue();
                                                                
      echo"<tr>";
           echo"<td>";
                $name = $objPHPExcel->getActiveSheet(0)->getCell('A'.$i)->getCalculatedValue(); 
                echo e($name); 
           echo"</td>";
                for($column = 'B'; $column != $highestColumm; $column++){
                   echo"<td>"; 
                        $name = $objPHPExcel->getActiveSheet(0)->getCell($column.$i)->getCalculatedValue();                                                                                                                
                        echo e($name);                                                                  
                   echo"</td>";
                 }                                                                  
      echo"</tr>";
    ?>
</tbody> 

I tried var_dump($highestRow) but my controller is just passing over the breakpoint. I’m looking for some x_debug() thing to use for debugging.

All I remember there is some function in Xdebug to debug in such a case.

Thanks

Advertisement

Answer

We can use xdebug_break() here. As this function can break any line inside PHP.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement