text formatting cells

Mar 22 at 9:03 PM
Good day;

I have this code segment :
$ ObjPHPExcel- > setActiveSheetIndex ( 0 )
-> SetCellValue ( ' B' $ i , $ register- > zeros. ) ;
My question is how to format text to the cells because the zeros are lost to the left
Mar 22 at 9:17 PM
Numbers don't have leading zeroes; only a human visualisation of a numeric value.

If you want to see leading zeroes, then you have two choices.

Apply a number format mask, as described in the 'PHPExcel documentation'

or (assuming you have a string formatted with zeroes already) then use setCellValueExplicit() to specify that the value is a string