The purpose of this project is creating all usable ways of PHP coding.
This gist will contain:
- Variables
- Control Structures
- Loops
- Classes
| <?php | |
| /** | |
| * Function - addNumbers() | |
| * | |
| * This function adds the numbers old school way. It starts from last digit | |
| * and add them by one by one. If results greater than 9, it takes the first | |
| * digit to add it to next adding step. | |
| * | |
| * @author Gökhan ÖZTÜRK <gokhan@eg-ozturk.com> |
| This is gist. | |
| There are many like it, but this one is mine. | |
| It is my life. | |
| I must master it as I must master my life. | |
| Without me gist is useless. | |
| Without gist, I am useless. |
| <?php | |
| function subsetSumRecursive($numbers, $arraySize, $level = 1, $i = 0, $addThis = []) | |
| { | |
| if ($level == $arraySize) { | |
| $result = []; | |
| for (; $i < count($numbers); $i++) { | |
| $result[] = array_merge($addThis, array($numbers[$i])); | |
| } | |
| return $result; |
| # Your init script | |
| # | |
| # Atom will evaluate this file each time a new window is opened. It is run | |
| # after packages are loaded/activated and after the previous editor state | |
| # has been restored. | |
| # | |
| # An example hack to log to the console when each text editor is saved. | |
| # | |
| # atom.workspace.observeTextEditors (editor) -> | |
| # editor.onDidSave -> |
Ctrl + Alt + Space