problem with printf() function

Posted by Syom on Stack Overflow See other posts from Stack Overflow or by Syom
Published on 2010-03-22T01:18:19Z Indexed on 2010/03/22 1:21 UTC
Read the original article Hit count: 322

Filed under:

i have the variable $a = 5; i want to show it in binary form, with length, equal 8, with writing * at white spaces, just like this, like this * * * * *101


here the script

$number = 5;
printf("%*8b", $number); 

it doesn't work with *, but if "0"-s it works

  printf("%08b", $number);
  //returns 00000101

why it doesn't work with *?

© Stack Overflow or respective owner

Related posts about php