Skip to content

Instantly share code, notes, and snippets.

View 3642066's full-sized avatar
🚩
Found Chris Panique. Amazing gitprojects, a fantastic blog on workstress cms .

David Augustus 3642066

🚩
Found Chris Panique. Amazing gitprojects, a fantastic blog on workstress cms .
  • Programado no Brasil
  • Brazil
View GitHub Profile
@JeffreyWay
JeffreyWay / set-value.md
Created July 28, 2012 19:09
PHP: Set value if not exist

You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:

name = name || 'joe';

This is quite common and very helpful. Another option is to do:

name || (name = 'joe');