Skip to content

Instantly share code, notes, and snippets.

@kingkarki
Last active December 30, 2015 18:39
Show Gist options
  • Select an option

  • Save kingkarki/7869242 to your computer and use it in GitHub Desktop.

Select an option

Save kingkarki/7869242 to your computer and use it in GitHub Desktop.

Revisions

  1. kingkarki renamed this gist Dec 9, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. kingkarki created this gist Dec 9, 2013.
    21 changes: 21 additions & 0 deletions debug function
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    <?php

    if (!defined('BASEPATH'))
    exit('No direct script access allowed');
    if (!function_exists('debug')) {

    function debug($data) {

    $dub = debug_backtrace();


    echo '<pre><span style="color:blue">';
    echo $dub[0]['file'] . "<br/>On Line Number ";
    echo $dub[0]['line'] . "<br/></span>";
    print_r($data);

    echo '</pre>';
    }

    }
    ?>