|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-21 22:48 UTC] damon dot dean at revcube dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 18 08:00:02 2025 UTC |
Description: ------------ I'm not sure if this is a bug, or by design, but this function works differently than others I've seen in PHP. No matter I try, if I try to pass a file name as a variable to ZipArchive::renameName, it prints the name of the variable as the filename, rather than the value of the variable. Reproduce code: --------------- <?php $logDateTime = date('Y_m_d_H_i_s'); $CSVFileName = "HGN_GGL"._."$logDateTime".".csv"; $zip = new ZipArchive; if ($zip->open('./reports/report-csv.zip') === TRUE) { //Also tried '' and ""with function below $zip->renameName('report.csv', $CSVFileName); $zip->extractTo('./reports'); echo "Yay!"; } else { echo "Boo"; } ?> Expected result: ---------------- I would expect it to output a file with a name along the lines of this: HGN_GGL_2006_11_21_14_17_07.csv Actual result: -------------- Instead, it produces a file name like this: $CSVFileName