Skip to content

Instantly share code, notes, and snippets.

@bakura10
Last active December 22, 2015 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakura10/6411495 to your computer and use it in GitHub Desktop.
Save bakura10/6411495 to your computer and use it in GitHub Desktop.
<?php
// I need to get a specific key of the array (for instance "c"), and then be able FROM THIS new array,
// go back to the previous level
$data = array(
'a' => 'aaaa',
'b' => 'bbbb',
'c' => array(
'd' => 'dddd',
'e' => 'eeee',
'f' => array(
'g' => 'gggg',
'h' => 'hhhh'
),
'i' => 'iiii'
),
'j' => 'jjjj'
);
$toTest = &$data['c'];
//var_dump($toTest);
$toTest = prev($toTest);
var_dump($toTest); // I want to test to be array('a' => 'aaaaa'....)
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment