Find different digits PHP
<p>I have string </p>

<blockquote>
  <p>$a = '123456789';</p>
</blockquote>

<p>what it the formula so it can give result that in string there are 9 different digits.</p>

<p>If i have </p>

<blockquote>
  <p>$a = '111222333444';</p>
</blockquote>

<p>so result should be </p>

<blockquote>
  <p>4</p>
</blockquote>
