note 125157 added to ziparchive.addfromstring

From: Date: Wed, 01 Jul 2020 06:32:27 +0000
Subject: note 125157 added to ziparchive.addfromstring
Groups: php.notes 
Request: Send a blank email to php-notes+get-214821@lists.php.net to get a copy of this message
in case your string contain Arabic char, ZipArchive::addFromString will show it in wrong format char. in this case you have to change your string coding from Unicode to Windows-1256 code $filetxt = iconv('utf-8','CP1256',$filetxt); $zip = new ZipArchive; $zipFName = "Tmp.zip"; if ($zip->open($zipFName, ZipArchive::CREATE) === TRUE) { $zip->addFromString($fileName . '.csv', $filetxt); $zip->close(); } ---- Server IP: 45.112.84.4 Probable Submitter: 103.51.166.36 (proxied: 2001:16a2:39a5:800:11df:d1f9:4993:32f9) ---- Manual Page -- http://php.net/manual/en/ziparchive.addfromstring.php Edit -- https://master.php.net/note/edit/125157 Del: integrated -- https://master.php.net/note/delete/125157/integrated Del: useless -- https://master.php.net/note/delete/125157/useless Del: bad code -- https://master.php.net/note/delete/125157/bad+code Del: spam -- https://master.php.net/note/delete/125157/spam Del: non-english -- https://master.php.net/note/delete/125157/non-english Del: in docs -- https://master.php.net/note/delete/125157/in+docs Del: other reasons-- https://master.php.net/note/delete/125157 Reject -- https://master.php.net/note/reject/125157 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214821) next »