php - Adding spaces in converted hex -


i have example data converted hex

$convertohex = "##x27,5556789,a89,2*";  $convertedhex = bin2hex($convertohex); 

how add spaces can output this

23 23 58 32 37 2c 35 35 35 36 37 38 39 2c 41 38 39 2c 32 2a 

thank in advance.

use chunk_split() function in php split string smaller parts.use code below :

<?php     $convertohex = "##x27,5556789,a89,2*";      $convertedhex = bin2hex($convertohex);     echo chunk_split($convertedhex, 2, ' '); ?> 

hope helps you.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

Error while updating a record in APEX screen -

c++ - In an add-in in Excel, written in C(++), how does one get the name of the function which called into the addin? -