title: Add substring at beginning of string if doesn't exist (php)
body: <p>I want to add a substring (text) at beginning of string only if this string doesn't have already this text at beginning.</p>
  
  <p>I am interested in the fastest solution.</p>
  
  <p>Example:</p>
  
  <pre><code>// let's say I want to add "Has" at beginning (if doesn't exist)
  
  $string_1 = "AnaHasSomeApples"; // we need to add
  $string_1 = "HsSomeApples"; // we need to add
  $string_2 = "HasApplesAlready"; // already exists at the beginning
  </code></pre>
  
  <p>I tried this:</p>
  
  <pre><code>$string = (strpos($string, 'Has') === false ? 'Has' : '') . $string;
  </code></pre>
  
  <p>I know is not hard to do that. But I want the fastest (according to time, not lines of code) possible way.
  Thank you.</p>