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

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -