0
votes

I want convert 365 decimal to binary (each number four bytes) So i convert:

pack("s*",1); // output .... , in hexedidor: 01000000

And this is the correct output But when conver 365 :

pack("s*",365); // output m... in hexeditr:6D000100

But I expect 6D010000 How can I get that conclusion? example output I need 1

my code :

$content= pack("s*",365);
file_put_contents("file.txt",iconv("UTF-8","UTF-16LE",$content));
i am getting strange output like this m can you show how you getting that binary stringEr. Amit Joshi
you want binary conversion of BCD conversion??Er. Amit Joshi
I did not ask the question correctly and I've updated it now I'm going to get out 6D010000 instead 6D000100 when number 365 becomeslock
Can you post the complete code @lockEr. Amit Joshi
Excuse me if I can not properly transfer the purpose ,I do not have a specific code, and I'm the ones that I put in question I'm going to get 365 become like that example, I added an image of the final output required for the questionlock