title: How to take required bits from a string in php?
body: <p>I have a data frame converted to binary string.I need to extract particular bits from that string.Could anyone please tell me how can I do that?</p>
  
  <p>I have this binary string and have splitted this string into array. I am able to access each single bit but not able to take chunk from it.</p>
  
  <p>$str="11110000111100000001<strong>101010101010</strong>0010<strong>101110111011</strong>";</p>
  
  <pre><code>print_r(str_split($str));
  </code></pre>
  
  <p>I want that particular bits in bold from the string  and print that.</p>
  
  <pre><code>$var=101010101010;
  echo ($var);
  $var2=101110111011;
  echo ($var2);
  </code></pre>
  
  <p>This is typeof what is needed but not able to understand how do I take it from the string.</p>