note 48031 added to function.ascii2ebcdic
| From: | buzuk at free dot fr | Date: | Thu, 09 Dec 2004 14:29:41 +0000 |
| Subject: | note 48031 added to function.ascii2ebcdic | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-81590@lists.php.net to get a copy of this message | ||
If you need to convert IBM EBCDIC Comp or Comp-3 format (AS/400 Packed) you can use this function :
<?
/** Convert COMP or COMP-3 EBCDIC DATA
** @param binary $zComp Original EBCDIC Comp or Comp3 formated number
** @return int
**/
function comp2int( $zComp) {
$zTemp='';
for ($i=0; $i<4; $i++)
$zTemp.=sprintf("%08d", decbin(ord($zComp[$i])));
return bindec($zTemp);
}
?>
This function doesn't work with signed numbers.
----
Manual Page -- http://www.php.net/manual/en/function.ascii2ebcdic.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48031
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48031&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48031&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48031&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48031&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48031&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48031&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48031&report=yes
Search -- http://master.php.net/manage/user-notes.php