Skip to content

Instantly share code, notes, and snippets.

View nzuwera's full-sized avatar

Nzuwera Gilbert nzuwera

View GitHub Profile
/*
How to install and configure PHP to connect MSSQL on windows
Step 1: Download Microsoft ODBC related to Xampp or Wamp : https://www.microsoft.com/en-us/download/details.aspx?id=50420
Step 2: Download Microsoft SQL Driver for PHP related to your PHP version : https://docs.microsoft.com/en-us/sql/connect/php/sqlsrv-driver-api-reference?view=sql-server-2017
Step 3: Add the extracted dll file in php extentsion directory
Step 4: update php.ini to load the new extensions
Step 5: Restart Apache server
Step 6: Test connection below script. just remember to use the correct credentials for your database
*/
@nzuwera
nzuwera / EasyTree.php
Created February 10, 2018 19:45 — forked from studentIvan/EasyTree.php
EasyTree php tree build algorithm
<?php
/**
* 1. This Algorithm can help you build tree as a nested php array from array like ('id' => x, 'parent_id' => y)
* 2. Algorithm speed = {O(n log n) + О(N)}
*/
class EasyTree
{
public static
$idKeyName = 'id', $parentIdKeyName = 'parent_id', $childrenKeyName = 'children';
@nzuwera
nzuwera / cli.args.php
Created January 9, 2018 14:07 — forked from jadb/cli.args.php
Parse PHP CLI arguments
http://pwfisher.com/nucleus/index.php?itemid=45
This command line option parser supports any combination of three types of options (switches, flags and arguments) and returns a simple array.
<?php
/**
* CommandLine class
*
* @package Framework
*/
/**
<?php
/**
* Simple FTP Class
*
* @package SFTP
* @name SFTP
* @version 1.0
* @author Shay Anderson 05.11
* @link shayanderson.com
* @license http://www.gnu.org/licenses/gpl.html GPL License