in PHP how to generate all possible patterns of a string?
<p>I have this code to generate all posibilites of a string</p>

<pre><code>  &lt;?PHP       
  for($i=0;$i&lt; 16;$i++){

    echo decbin($i)."&lt;br&gt;";
  }
  ?&gt;
</code></pre>

<p>this will print</p>

<pre><code>0

1

10

11

100

101

110

111

1000

1001

1010
</code></pre>

<p>what I want is combining this binary data with a string of 4 letters by replacing all the ones with "*"
so when you input the string "help" you will get</p>

<pre><code>help

hel*

he*p

he**
</code></pre>

<p>etc...</p>

<p>I am struggling
any Idea will be appreciated?</p>

<p>Thanks</p>
