V
V
Valera Karmanov2020-04-28 11:54:49
PHP
Valera Karmanov, 2020-04-28 11:54:49

(PHPExcel) How do I put the euro sign in a cell?

Good afternoon! How to write to a cell Betrag €so that it would be considered a string?
Now the output is 0 (zero)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
anikavoi, 2020-04-28
@anikavoi

What string encoding?
https://www.php.net/manual/ru/function.utf8-encode.php

D
Daria Motorina, 2020-04-28
@glaphire

I copied the text from your question, everything turned out fine

$objPHPExcel = new PHPExcel();
        $objPHPExcel->setActiveSheetIndex(0)
            ->setCellValue('A1', 'Hello')
            ->setCellValue('B2', 'world!')
            ->setCellValue('D2', 'Betrag €');

        $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
        $objWriter->save(str_replace('.php', '.xls', __FILE__));

5ea82f4cb1a67596224457.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question