Skip to content

Instantly share code, notes, and snippets.

@krishjun
Last active September 26, 2018 13:45
Show Gist options
  • Select an option

  • Save krishjun/a9dbb221f5bb52bbb05de8c31272391e to your computer and use it in GitHub Desktop.

Select an option

Save krishjun/a9dbb221f5bb52bbb05de8c31272391e to your computer and use it in GitHub Desktop.

Revisions

  1. krishjun renamed this gist Sep 26, 2018. 1 changed file with 8 additions and 7 deletions.
    15 changes: 8 additions & 7 deletions gistfile1.txt → reverseMe
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,17 @@

    function($input) {



    function reverseMe($input) {



    $len = strlen($input);

    $output = '';

    for($i = $len - 1 ; $i > -1 ; $i--) {
    $output .= $input[$i];
    $output .= $input[$i];
    }

    return $output;
    }
    return $output;

    }
  2. krishjun revised this gist Sep 26, 2018. 1 changed file with 11 additions and 5 deletions.
    16 changes: 11 additions & 5 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,16 @@
    $temp = 'abc';

    function($input) {



    $len = strlen($temp);
    $len = strlen($input);

    $result = '';
    $output = '';

    for($i = $len - 1 ; $i > -1 ; $i--) {
    $result .= $temp[$i];
    $output .= $input[$i];
    }
    var_dump($result);exit;

    return $output;

    }
  3. krishjun created this gist Sep 26, 2018.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    $temp = 'abc';

    $len = strlen($temp);

    $result = '';

    for($i = $len - 1 ; $i > -1 ; $i--) {
    $result .= $temp[$i];
    }
    var_dump($result);exit;