title: How do I remove everything after a space in PHP?
body: <p>I have a database that has names and I want to use PHP replace after the space on names, data example:</p>
  
  <pre><code>$x="Laura Smith";
  $y="John. Smith"
  $z="John Doe";
  </code></pre>
  
  <p>I want it to return</p>
  
  <pre><code>Laura
  John.
  John
  </code></pre>