title: How to check if a string starts with another string - PHP
body: <p>I want test if a <code>String1</code> start by a <code>string2</code> in <code>PHP</code></p>
  
  <p>I found this question:
  <a href="https://stackoverflow.com/questions/2790899/how-to-check-if-a-string-starts-with-a-specified-string">How to check if a string starts with a specified string</a></p>
  
  <p>But I want do it inside an <code>if</code> condition - not in a function.
  I did it like this but I'm not sure:</p>
  
  <pre><code>if(startsWith($type_price,"repair")) {
  
  do something
  
  } 
  </code></pre>
  
  <p>Can you please correct me if it's false?</p>