I want to display unit numbers in front of Property name. I fetched my data in $arrobjPropertyName
array object and in foreach loop I print it as
foreach( $arrobjPropertyName as $objProperty ) {
$objWriteExcelWorksheet->write( $intRowCount, $intColumnCount++, $objProperty->getUnitNumber(), $objWorkbookContent );}
it will give the output 613 or 722 but i want it like 0613 or 0722 in excel record.
Please any suggestions are welcomed.
foreach( $arrobjPropertyName as $objProperty ) {
$objWriteExcelWorksheet->write( $intRowCount, $intColumnCount++, "'" . $objProperty->getUnitNumber(), $objWorkbookContent );}
you should tell excell it is a string. otherwise it will interpret as number and remove all leading 0s.
To be more elaborate: if you type 0123 in excell manually, it will auto convert to 123. If you type '0123 in excell manually it will stay like 0123. So not only php has to know it is a string (so that php doens't remove the 0. but you must also tell excell excplicitly.
Update: sorry, forgot, excell only needs first '