title: ASP to PHP ... simplifying php code
body: <p>i'm converting some asp coding to php, from what I've done in php is there a better way to simplify things so I'm not writing an extra line of coding?</p>
  
  <p>asp</p>
  
  <pre><code>xFirstName = LCase(Replace(request.form("xFirstName"), "'", "''"))
  xFirstName = UCase(Left(xFirstName,1))&amp; Mid(xFirstName,2)
  </code></pre>
  
  <p>php</p>
  
  <pre><code>$xFirstName = strtolower(str_replace("'","''",$_POST["xFirstName"]));
  $xFirstName = strtoupper(substr($xFirstName,0,1)).substr($xFirstName,1);
  </code></pre>