title: php replace first occurrence of string from 0th position
body: <p>I want to search and replace the first word with another in php like as follows:</p>
  
  <pre><code>$str="nothing inside";
  </code></pre>
  
  <p>Replace 'nothing' to 'something' by search and replace without using <code>substr</code></p>
  
  <p>output should be: 'something inside'</p>