Skip to content

Instantly share code, notes, and snippets.

@rubensayshi
Created May 2, 2014 13:55
Show Gist options
  • Save rubensayshi/897b5854f7283512d2e2 to your computer and use it in GitHub Desktop.
Save rubensayshi/897b5854f7283512d2e2 to your computer and use it in GitHub Desktop.
PHP, how I've missed you xD
<?php
$a = array("boaz", "ruben", "jop");
echo json_encode($a); // ["boaz","ruben","jop"]
unset($a[1]);
echo json_encode($a); // {"0":"boaz","2":"jop"}
$a = array("boaz", "ruben", "jop");
echo json_encode($a); // ["boaz","ruben","jop"]
array_splice($a, 1, 1);
echo json_encode($a); // ["boaz","jop"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment