Note that there are some explanatory texts on larger screens.

plurals
  1. USHalf Crazed
    primarykey
    data
    text
    <p>Developing while learning and helping others.</p> <p><strong>Top PHP issues I see on SO and my suggestions:</strong></p> <ol> <li><a href="http://stackoverflow.com/a/14110189/788192">Stop using <code>mysql_*</code> functions. They are deprecated.</a> Instead, look into using <code>PDO</code> along with binding values. <a href="http://stackoverflow.com/questions/1179874/what-is-the-difference-between-bindparam-and-bindvalue">Be aware that <code>bindValue</code> and <code>bindParam</code> work differently.</a></li> <li><a href="http://stackoverflow.com/a/31943849/788192">Stop using time stamps. Use the <code>DateTime</code> object instead.</a> Convert all of your time stamps in tables to the <code>DATETIME</code> type as well. You'll no longer have to worry about which PHP architecture you're on and you'll have a plethora of functionality readily available instead of writing your own.</li> <li><p><a href="http://stackoverflow.com/a/17497184/788192">You can pass external variables into a closure's scope</a>, along with the ability to modify it (if passed by reference using <code>&amp;</code>), by using the <code>use</code> keyword. Example: </p> <p><code>$externalVar = 10; print_r(array_map(function($value) use (&amp;$externalVar) { $externalVar++; return $value * $externalVar; }, range(1, 10)));</code></p></li> <li><p>Use CSRF tokens in your forms! And clear them after single use! <a href="http://stackoverflow.com/a/17244070/788192">Old laravel example</a></p></li> <li>If Google PageSpeed docks your score for analytics, then <a href="http://stackoverflow.com/a/41065130/788192">cheat back</a>!</li> <li><a href="http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags">You can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML.</a></li> </ol>
    plurals
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload