What is the difference between using setCellValue and setCellValueByColumnAndRow in PHPExcel?
The main difference between using setCellValue and setCellValueByColumnAndRow in PHPExcel is the way you specify the cell location. setCellValue takes the cell coordinates in the form of 'A1', 'B2', etc., while setCellValueByColumnAndRow takes the column index and row number as parameters. If you prefer using column indexes and row numbers, you should use setCellValueByColumnAndRow.
// Using setCellValue
$objPHPExcel->getActiveSheet()->setCellValue('A1', 'Hello World');
// Using setCellValueByColumnAndRow
$objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow(0, 1, 'Hello World');