php - Search for a binary number in a set that contains a 1 or 0 in certain locations -


I have strings (zero and others) that have a format similar to the following:

[01100101], [10010000], [00000001] ... and so on (all the same length, there are about 30 entries)

I want to be able to search similar to "0xxxx01" Search for these numbers using search will return the first and the third string in this case.

What would be the best way to do this? I am in the middle of learning PHP, an answer will be liked in that format. Posted by Building @ George Launde (you need to use X instead of X)

Top of answer:

  $ arr = array ('01100101', '10010000', '00000001'); $ Result = preg_grap ("/ 0 ..... 01 /", $ arr); Print_r ($ result);   



Comments

Popular posts from this blog

c# - passing input text from view to contoller with FacebookContext using Facebook app -

ios - Does Core Data autoupdate a many to many relationship on saving -

Calling a C++ function from C# by passing a string with variable size to it -