fork download
  1. <?php
  2. $string = "10100101";
  3. $binary = (binary) $string;
  4. var_dump($binary);
  5. $binary = b"10100101";
  6. var_dump($binary);
  7.  
  8. //https://pt.stackoverflow.com/q/48389/101
Success #stdin #stdout 0.01s 82560KB
stdin
Standard input is empty
stdout
string(8) "10100101"
string(8) "10100101"