|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-06-08 23:12 UTC] ceeckels at mac dot com
Description: ------------ No comment; just run the test script and notice that the array item 7 is missing in the result string Test script: --------------- <?php $ar = [12345678, 12345678, 12345678, 3, 4, 5, 6, 7, 8]; echo implode(chr(9), $ar), PHP_EOL; ?> Expected result: ---------------- 12345678 12345678 12345678 3 4 5 6 7 8 Actual result: -------------- 12345678 12345678 12345678 3 4 5 6 8 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
Also, this has a very small chance of being a weird interaction between your terminal and the bytes. Please could you run this to see what implode is actually doing. function getRawCharacters($result) { $resultInHex = unpack('H*', $result); $resultInHex = $resultInHex[1]; $resultSeparated = implode(', ', str_split($resultInHex, 2)); return $resultSeparated; } $ar = [12345678, 12345678, 12345678, 3, 4, 5, 6, 7, 8]; $string = implode(chr(9), $ar); echo getRawCharacters($string) . PHP_EOL;