title: PHP: return length of each array Element or stop
body: <p>given I have an array, say:</p>
  
  <pre><code>$myArray=['12','AB','3C']
  </code></pre>
  
  <p>I want to return the value 2 (which is the length of each of the array elements indivudually.)</p>
  
  <p>But in case I have something like </p>
  
  <pre><code>$myArray=['12','AB2','3C']
  </code></pre>
  
  <p>I want to <strong>stop the calculation/loop right after the second element</strong> of the array <code>'AB2'</code> and let my function return null.</p>
  
  <p>What is the most effective way to reach this in the matter of being performance and speed effective? Since such an array can get long.</p>