Skip to content

Instantly share code, notes, and snippets.

View devd123's full-sized avatar

Devdutt Sharma devd123

View GitHub Profile
@devd123
devd123 / file.php
Created July 29, 2017 04:22
API Login & Registration
https://www.androidhive.info/2012/01/android-login-and-registration-with-php-mysql-and-sqlite/
@devd123
devd123 / Phpmyadmin Multiple Host Login
Created April 25, 2017 06:21
multiple host login in phpmyadmin
// Add this code in etc/phpmyadmin/config.inc.php file of lamp
$i++;
$cfg['Servers'][$i]['host'] = 'yourhostname';
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['verbose'] = 'SERVER_NAME';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['compress'] = TRUE;
@devd123
devd123 / longestPalindrome.php
Created April 24, 2017 05:58
Find longest palindrome string in php
<?php
/**
* find the longest palindrome in a string
* website : neerusite.wordpress.com
* Auther : Devdutt Sharma
*/
function longestPalindrome($string = ''){
$strArr = array();
@devd123
devd123 / recursive function
Created April 14, 2017 10:43
Parent Child Tree PHP Recursion
public function getresultTree(array $elements, $parentId = 0) {
$branch = array();
foreach ($elements as $element) {
if ($element['parent_id'] == $parentId) {
$children = getresultTree($elements, $element['id']);
if ($children) {
@devd123
devd123 / Template.php
Created June 1, 2016 13:43
Templateing in codeigniter
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Template
{
var $ci;
function __construct()
{
$this->ci =& get_instance();
}
@devd123
devd123 / parse.js
Last active August 29, 2015 14:25
jquery - Parse JSON with jQuery Example
/********************************** example **************************************/
var base_url = 'http://people.cs.uct.ac.za/~swatermeyer/VulaMobi/';
function example()
{
var response = "";
var form_data = {
username: username,
password: password