(PHP ActiveX) Appending Strings to BinData
Demonstrates appending strings to a BinData..
<?php
// For versions of Chilkat < 10.0.0, use new COM('Chilkat_9_5_0.Chilkat.BinData')
$binData1 = new COM("Chilkat.BinData");
// Append a string using a 1-byte per char encoding
$binData1->AppendString('This is a test','windows-1252');
print $binData1->getEncoded('hex') . "\n";
// The bytes contained within the binData1 (in hex) are: 54,68,69,73,20,69, ...
// For versions of Chilkat < 10.0.0, use new COM('Chilkat_9_5_0.Chilkat.BinData')
$binData2 = new COM("Chilkat.BinData");
// Append a string using a 2-byte per char encoding
$binData2->AppendString('This is a test','utf-16');
print $binData2->getEncoded('hex') . "\n";
// The bytes contained within the binData2 (in hex) are: 54,00,68,00,69,00,73,00,20,00,69,00, ...
?>
|