note 57612 added to function.unpack

From: Date: Sat, 08 Oct 2005 19:10:50 +0000
Subject: note 57612 added to function.unpack
Groups: php.notes 
Request: Send a blank email to php-notes+get-96696@lists.php.net to get a copy of this message
I hadn't realized that if the number after the unpack type was 1 (i.e. "V1page"), that it would behave as if there was no number at all. I had been using a variable and didn't think to watch for this. For instance, <?php if ($something) $get = 2; else $get = 1; $arr = unpack("V" . $get . "page", $data); ?> Now if $something was FALSE, then $arr will only have one entry named "page". If $something was TRUE, $arr would have "page1" and "page2". ---- Manual Page -- http://www.php.net/manual/en/function.unpack.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57612 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57612&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57612&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57612&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57612&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57612&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57612&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57612&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57612&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#96696) next »